views:

1825

answers:

5

I am trying to draw a domain model or class diagram in UML for car dealership. I am stuck with how to present test drive in the model. One way is to have appointment class and then test-drive as sub class. A dealer also offers after-sale vehicle service so i could have appointment/booking class as super class and then vehicle service and test-drive as two sub classes.

Another way is to have the customer class have a direct relationship with test drive class and vehicle service class under appointment class.

A dealer also sells new and used cars and their parts.

A dealer also offers finance for car sale.

Would testdrive class have relationship with vehicle class or there is separate class for display and testdrive class?

Another question is how do I show potential customers and their inquiries about sale and service in the model. A dealer wants to save details of potential customers if they allow for marketing purposes. Shall I have two classes: one for customers and one for potential customers or it can be achieved just by using an attribute in customer class?

+2  A: 

You can really only distinguish the right decision by having a good set of use cases or expected behaviors of the model.

This will inform whether a particular sub-classing is really accurate.

I can see that an appointment might contain several test-drives, which are themselves linked to individual vehicles, So a test-drive itself is nothing more than a link from a customer to a vehicle which are linked to an appointment.

Cade Roux
A: 

but i need to store information for testdrive, which will not be possible with the link only. if you mean link as relationship here.

or may be you are right?

A: 

test-drive would contain the information relevant only to the test-drive:

reference to the customer - even this might be debatable to include

reference to the vehicle

length of test drive

location (perhaps the vehicle was driven at a different location than could be determined from the owning appointment)

customer temperature (hot or cold - i.e. did the customer seem enthusiastic)

comments

etc.

But what is not in the test-drive object is anything related to the appointment - since it is always contained in a collection - possibly as part of an appointment or some other event container. Now if the containers which can contain test-drives always include customer information, I might not even include the customer reference in the test-drive object - after all, it will be redundant.

It depends if test-drives can occur in non-appointment scenarios - perhaps at a "sales event" or an "open house" or something where appointments are not actually created in the use cases - or if test-drives for multiple customers will occur within a container.

Cade Roux
A: 

The second part of your question has been forgotten (easily done when you ask two questions in one):

Another question is how do I show potential customers and their inquiries about sale and service in the model. A dealer wants to save details of potential customers if they allow for marketing purposes. Shall I have two classes: one for customers and one for potential customers or it can be achieved just by using an attribute in customer class?

I think your use case there is "A dealer wants to save details of potential customers if they allow for marketing purposes." and the simplest solution is to have a Mailing List collection which holds name and address of each potential customer.

chimp
A: 

class diagram for driver and operation#