views:

20

answers:

2

I have a class called 'Inventory' that has two subclasses, 'Drink' and 'Condiment'. They are a part of a software system being developed for use in a hot drinks vending machine. Note that this isn't really going to be implemented, rather it is a piece of coursework for my Software Engineering class. Anyway, I'm having trouble deciding what stereotype to apply to 'Inventory', as I can see it having aspects of both a control class (managing the drinks and condiments during a transaction), and of an entity class (noting the quantities of each item in its subclasses, but it also is the sole manager of the water water levels, as hot water is common to all drinks dispenses from this machine).

I'm basically looking for some guidance on how to classify this class. Thanks a lot.

A: 

I vote for entity class -- Having inventory is not the same as controlling inventory.

Bill Horvath II
+1  A: 

You might consider that since you are unsure how to classify it, perhaps you could design separate control and entity classes. First rule of software engineering: if the design feels wrong then it probably is.

Come to think of it, the zeroth rule is: know when to ignore the other rules, especially the ones about stereotypes and design patterns.

Cameron Skinner