UML CLASS DIAGRAMS
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   JAMES_WEST
Posted On:   Monday, January 19, 2004 08:40 PM

I am a newbie to UML and have to do this as a homework....Can anyone out there help me out with this problem, so I can have heads up? I need a good solution, so I can learn well.

Draw class and object diagrams for vehicle rental service.
A customer can rent any automobile including SUVs and trucks. The vehicle is rented for a certain number
of days and with a finite number of miles. Identify the relevant objects, and corresponding classes. Include relevant attributes and operations.

Re: UML CLASS DIAGRAMS

Posted By:   Anonymous  
Posted On:   Sunday, February 8, 2004 04:59 PM

Classes/Objects:
RentalRecord
-id:String
-customer:Customer
-rental_lines:RentalLine[]
+cancel():void
...

RentalLine
-vehicle:Vehicle
-start:Date
-end:Date
...

Vehicle
-id:String
-model_no:String
-color:int
-status:String [Repair/Hired/...]
+isAvailable():boolean
...

Customer
-id:String
-first_name:String
-last_name:String
-cerdits:double
...

SUV [inherits Vehicle]
...

Truck [inherits Vehicle]
...


[Visit: All about UML]

Re: UML CLASS DIAGRAMS

Posted By:   Simon_Ablett  
Posted On:   Tuesday, January 20, 2004 03:22 AM

Sorry but we don't do other people's homework here. There's no right and wrong answers in object modelling only optimal and less optimal solutions. You'll learn far more by attempting the work yourself and then asking specific questions as and when they arise. Start with the requirements document (your exam quiz in this case). Look for noun-phrases (note to other Gurus: yep there are other ways but this is the simplest in my opinion) and use these as a starting point for identifying relevant classes. Then see if you can identify which behaviour (methods) each class will have. Finally identify the inter-relationships between the classes. During this process, some classes will become redundant and disappear whilst others will be introduced. You'll find it easier as you gain experience but the only way to gain that experience is through practice.

Regards.
About | Sitemap | Contact