aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Domain model and class diagram Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Domain model and class diagram" Watch "Domain model and class diagram" New topic
Author

Domain model and class diagram

Nilessh Ganu
Ranch Hand

Joined: Dec 22, 2009
Posts: 100
Hi,
I have question about the relation between: Domain model in the assignment and the class diagram.

Suppose there are domain objects like say Dog, Cat and Elephant. It doesn't make sense to represent them as classes in the Class diagram if they do not exhibit their own specialized behavior. If my system doen't makes any difference if the Animal is Cat or Dog or Elephant to define the behavior, can we use only a class like Animal with a properties in it having animalType/animalName ?

On the database side, I think Dog, Cat, Elephant would only be rows in Animal table.

So is it allowed to exclude the domain objects listed in the requirement and use a generic type instead in the class diagram?


Nilesh
SCJP SCWCD OCMJEA
David Byron
Rancher

Joined: Jan 20, 2009
Posts: 172

Nilessh Ganu wrote:If my system doen't makes any difference if the Animal is Cat or Dog or Elephant to define the behavior, can we use only a class like Animal with a properties in it having animalType/animalName ?
...
So is it allowed to exclude the domain objects listed in the requirement and use a generic type instead in the class diagram?


As I recall, one participant in the forum assumed it was OK to go to town with the Composite pattern for the sake of efficiency/elegance, and he failed. The evaluator described this simplified diagram as "catastrophically incomplete".

For this reason, if you face a choice between

(a) improving the assigned domain model
OR
(b) making assumptions that allow you to work with the assigned domain model as it stands

it might be wise to do (b) and not (a)! The class diagram should closely reflect the provided domain model.


OCMJD 6, OCPJP7, Baroque Potion, G+
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Domain model and class diagram