object-oriented design the player may choose to quit at appropriate points during play the interface will present visual cues to indicate what is going on at any given moment and what the valid user responses are identifying candidate objects our first step is to analyze the program description and identify some objects that will be useful in attacking this problem this is game involving dice and money are either of these good candidates for objectsboth the money and an individual die can be simply represented as numbers by themselvesthey do not seem to be good object candidates howeverthe game uses five diceand this sounds like collection we will need to be able to roll all the dice or selection of dice as well as analyze the collection to see what it scores we can encapsulate the information about the dice in dice class here are few obvious operations that this class will have to implementconstructor create the initial collection rollall assign random values to each of the five dice roll assign random value to some subset of the dicewhile maintaining the current value of others values return the current values of the five dice score return the score for the dice we can also think of the entire program as an object let' call the class pokerapp pokerapp object will keep track of the current amount of moneythe dicethe number of rollsetc it will implement run method that we use to get things started and also some helper methods that are used to implement run we won' know exactly what methods are needed until we design the main algorithm up to this pointi have concentrated on the actual game that we are implementing another component to this program will be the user interface one good way to break down the complexity of more sophisticated program is to separate the user interface from the main guts of the program this is often called the model-view approach our program implements some model (in this caseit models poker game)and the interface is view of the current state of the model one way of separating out the interface is to encapsulate the decisions about the interface in separate interface object an advantage of this approach is that we can change the look and feel of the program simply by substituting different interface object for examplewe might have text-based version of program and graphical version let' assume that our program will make use of an interface objectcall it pokerinterface it' not clear yet exactly what behaviors we will need from this classbut as we refine the pokerapp classwe will need to get information from the user and also display information about the game these will correspond to methods implemented by the pokerinterface class