Docsity

Software Architecture - Objects and Design - Assignment | CS 2340, Assignments of Computer Science

Partial preview of the text

Download Software Architecture - Objects and Design - Assignment | CS 2340 and more Assignments Computer Science in PDF only on Docsity!

WTB Team – M

Page 1…...Software Architecture

Page 2…….Class Utility Objects

Page 3…Team member contracts

Page 5……..Exception handling

Page 6……………..UI Mockup

Software Architecture

Layered Architecture. Dotted lines are trust boundaries.

AppModel

GUI

GameLoader Game EventHandler Parser Save Files (^) Configuration Files Application Model/View Domain Model Data

Contracts:

Assignment from M5 Requirements: Submit a written contract (1 per person on the team) for an object or method in the design. Remember that the contract is basically the pre and post conditions of the method, or guarantees of the object as a whole. Event move: move Obligations Benefits Client: Event (precondition) person exists, location exists. Event knows person and controls where person goes while person doesn't have to know location Service provider: person, fromLocation, toLocation (preconditions) person is not dead, toLocation is accessible from fromLocation (postcondition) person is moved from fromLocation to toLocation. person is now at a new location without having to create and destroy a new person object Person drop: drop Obligations Benefits Client: Person Person exists, location exists, Item gets subtracted from Inventory maintained by person’s Inventoriable interface. Inventory free of one item Service provider: Inventory, Location (preconditions) item in inventory, location exists (postcondition) removeItem from Inventory. Person’s location’s inventory adds Item. Item is now accessible to player at location where dropped and can be picked up again (take())

Parser parseEvent parseEvent Obligations Benefits Client: Game (precondition) input text exists Parser splits command text into individual words Service provider: Parser (preconditions) input text exists, (postcondition) Parser returns to Game a collection of strings EventHandler can now analyze each word by itself, allowing more complex commands EventHandler handle: handle Obligations Benefits Client: Game (precondition) Event must have valid referenced objects Event objects can be used without exceptions. Service provider: EventHandler (postcondition) Ensure that the corresponding Event was run if it exists. The game state corresponds to the user's expectations.

UI Mockup