• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Domain model and class diagram

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 175
Clojure Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic