You are on page 1of 4

Programming 2 (COSC2136 / CPT 221) Study Period 2, 2012

House Designer System (HomeCAD)


Assignment 1 Part A: Design phase (7 marks)
You task is to design a simple House Designer System (HomeCAD) at the class diagram level. No implementation is required at this stage since the non-graphical (model) portion of HomeCAD will be implemented in your next assignment (1B), with the Graphical User Interface (GUI) covered in the final assignment (2).

Your design should consist of a collection of interacting classes/interfaces needed to capture and manipulate information about: i) ii) iii) iv) the house and its owner; the individual rooms within the house; the items contained within a room; the doorways (exit points) between rooms.

The design must also include a unified front end to be utilised by (as yet undefined) user-interface portion of the system, through the provision of a HomeCADengine faade class that provides a single point of entry for all high-level operations. This front end will also allow the testing of your program, independently of a graphical user interface, using the supplied test harness in Assignment 1 Part B.

HomeCAD Scenario
The system will need to be modelled as a collection of OO entities detailed below. NOTE: the classes described below represent the core system entities only. Feel free to incorporate additional classes/interfaces e.g. custom exception classes, data access classes to facilitate data encapsulation and storage; superclasses and class hierarchies to facilitate extensibility and reuse etc. House The house is defined as a three-dimensional space, inside of which room positions are denoted by three grid reference integers (x, y, z). Note that the z axis relates to individual stories. e.g. Below is a sample blueprint of the first storey (z=1) which contains three rooms, where room R1 is positioned at grid reference (1,1,1), room R6 positioned at (3,2,1), and room R8 positioned at (2,3,1).
R1

R6

R8

The house is dynamic and unbounded i.e. you can add any number of rooms to any number of stories.

Owner Each house has a single owner, who has a full name (e.g. Joe Bloggs); and an initial (or maximum) budget ($ value). The owners budget will be affected by every component, e.g. rooms and items, added to the house. Room Each room has: - a size (in cubic meters m 3 i.e. length x width x height); - a name (e.g. Kitchen); - an initial cost ($ value) which is calculated as: size (number of cubic meters) x predefined cost per cubic meter; - a number of unidirectional exit points. That is, if there is an exit point from the kitchen to the dining room, there must also be a corresponding exit from the dining room to the kitchen. Each exit point has a name (e.g. dining room door), and a destination grid reference (x,y,z) which must lead to an existing room. Also, exit points can lead to both horizontally (i.e. exit point = door) and vertically (i.e. exit point = staircase) adjacent rooms. Item Each room can store a collection of items, which have a textual description (e.g. Table) and a cost ($ value). Different types of items (e.g. household items and electronic appliances) can potentially have different behaviours as will be outlined in Assignment 1 Part B.

Functionality
At a minimum, the HomeCAD system should provide the following functionality (exposed via HomeCADengine faade): Add/remove a room Add/remove an exit point to/from the room Add/remove an item to/from the room Get a list (collection) of all the rooms in the house Get a list (collection) of all the rooms located on a given storey Get a room located at a particular grid reference Get a list (collection) of all the items in the room Get a list (collection) of all the exit points in the room Calculate the total size of all the rooms in the house (in cubic meters) Calculate the total size of all the rooms located on a given storey (in cubic meters) Calculate the size of a room (in cubic meters) Calculate the total cost of the house ($ value) Calculate the total cost of a given storey ($ value) Calculate the cost of a room ($ value) Get the grid dimensions (number of rows and columns) for a given storey Get the total number of stories in the house Reset the house/owner data, which involves: i) deleting all existing rooms, items, and exit points; and ii) re-setting the owners budget back to the initial maximum value. Check for structural feasibility i.e. upon adding/removing a room to/from the house, you need to check that: i) the room you are adding has some support underneath it. i.e. if you want to add a new room to the grid reference (1,2,5), you need to make sure that there is a corresponding support room on the storey below it (located at 1,2,4);

ii) the room you are removing wont break the structural rule described above, i.e. the room to be removed is not a support room. Check for financial feasibility i.e. the owners budget is not exceeded upon adding a new room or an item.

Designing the HomeCAD System


Attention must be paid towards how the HomeCAD is designed, including the following considerations to be made: The classes present in the system; Relationships between classes; The attributes and methods of each class o Attribute/parameter/return type, name, visibility, and modifiers (e.g. static, abstract, final) How high-level operations will be issued (initially) from the HomeCAD facade, and then filter down to the engine internals (i.e. specific classes); How data collections are to be stored and arranged; How errors and exceptional circumstances are to be reported (hint: try using custom exception classes to deal with important business-level exceptions).

Submission Instructions
You are to submit: 1. Class diagram/s representing the HomeCAD system, the requirements of which are described 1 above. You dont have to follow any specific format (although UML is highly recommended); however, you must clearly show all relevant object-oriented concepts such as association, composition, inheritance, interfaces, etc. You may use any drawing tool or CASE tool but the diagram must be exported and stored in one of the following formats to ensure your work can be assessed: Microsoft Word DOC format Adobe Acrobat PDF format (* preferred format) GIF, PNG or JPEG image format (please do not submit BMP files)

MAKE SURE that the diagram is readable; otherwise, you might not receive any marks for this part. 2. Answers to the following two questions with respect to your design: i) Consider the data structure (e.g. array, List, Map, etc.) you intend to use for the purpose of storing the collection of all the rooms. Why did you select this particular structure? What makes it appropriate for this situation? ii) How will your design facilitate the structural feasibility checks? Explain the sequence of method calls and passed/returned data using dot-point text or a better alternative such as a UML sequence diagram.

The design document (class diagram) and answers to the questions MUST be placed in one combined file (.pdf or .doc) and submitted via Weblearn by the end of week 3 at 11:59PM, Sunday th 17 June, 2012. Late submissions are handled as per usual RMIT regulations - 10% deduction (0.7 marks in Assignment 1 Part A) per day. You are only allowed to have 5 late days maximum.

You can find basic UML tutorials on the Course material page (on Blackboard).

IMPORTANT Regulations You are free to refer to textbooks and notes, and discuss the design issues (and associated general solutions) with your fellow members on the Discussion Board; however, the assignment should be your own individual work. Where you do make use of other references, please cite them in your work. Note that you will only be assessed on your own work so the use of third party designs is discouraged.

You might also like