File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Domain model and class diagram

 
Nilessh Ganu
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
David Byron
Rancher
Posts: 172
Clojure Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic