Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with this and fix this three and NOT make it one pieace of code and fix it as the application explains?

Can someone help me with this and fix this three and NOT make it one pieace of code and fix it as the application explains? image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Revise the code to incorporate common design patterns to make your code more efficient. Given the starter code, complete the Game Service, Program Driver, and SingletonTester classes. Begin by uploading CS 230 Project One Game App.zip as a new project in Eclipse. A tutorial is available for uploading files to Eclipse: Uploading Files to Eclipse Desktop Version Tutorial PDF. Please note: You will not complete the Player and Team classes at this time. To view the tasks you have been assigned, navigate in your Eclipse project to the Window, Show View, and Tasks view. You can double-click on any of the tasks (as seen in the image) to be directed to the line of code that needs to be completed where the tasks are located. A text version of this image is available: FIXME Text Version Word Document. Review the code for the Game Service class provided for you. Notice the static variables holding the next identifier to be assigned for game ld. Use the singleton pattern to adapt an ordinary class definition, so that only one instance of the GameService class exists in memory at any time. Explain the purpose and characteristics of the singleton pattern you are using in the context of this application. Include this brief explanation as comments in your code. The comments will be used to communicate your understanding of the pattern you implemented to your instructor. This multi-user game application must have the ability to have multiple instances of the game running at once, each having players and teams. Often, individual instances of the game will prompt users to save the new game being played. To ensure there are no duplicate instances of the game at the point of saving, the application must check to ensure that the name chosen by the user is not already in use. To meet this requirement, you will want to use an iterator pattern in the application. This will ensure that when a user starts a new game to play, the application checks every instance of the game already in play to determine if the new name chosen by the user is in use. Currently, most frameworks have iterator capabilities built in; it is rare to need to build an iterator from scratch. Therefore, we'll practice using one provided in Java. In the Game Service class, use the iterator pattern to complete the coding for the addGame() and both getGame() methods. Note: The getGame(name) method is needed to allow a game instance to be retrieved using only the unique name. Explain the purpose and characteristics of the iterator pattern you are using in the context of this application. Include this brief explanation as comments in your code. The comments will be used to communicate your understanding of the pattern you implemented to your instructor. Demonstrate industry standard best practices to enhance the readability of your code, including appropriate naming conventions and in-line comments that describe the functionality. Run and compile the code to ensure the application is functional and the requirements have been met.

Step by Step Solution

3.55 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Communication Essentials a skill based approach

Authors: Courtland L. Bovee, John V. Thill

6th edition

978-0132971324

More Books

Students also viewed these Programming questions

Question

What are the four parts of a technical proposal?

Answered: 1 week ago