mercredi 6 janvier 2016

How do I design this cake class?

I have to design a cake.I have identified the following objects(classes) and their respective attributes and functions.

Cakes(class)- has a list of Cake objects
Cake(Class) - has a list of key objects
Key(Class) - has a list of Order objects
Order(Class) - has a list of Customer objects
Customer(class)- Has regular and premium customer objects(classes)

This looks like a has-a nest for me, and when attempting to create a class diagram for the same, I end up with something like this: Cake class

How do I design this well? Will Cake be a superclass which has a nest of subclasses? How will I be able to get a list of customers given a cake_id? Do I have a cakes class which just point to a list of cake_ids above this hierarchy? How/Where do I set the properties of Cake? Kindly help. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire