• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can the domain objects be shown as class instances in class diagram?

 
Nilessh Ganu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Lets say I have domain objects like "pomerrian Dog", "Doberman Dog", "Bull Dog".
As it is mandatory to show the domain objects in assignment to be shown in class diagram, I am planning to show them as instances of class "Dog" in my class diagram like a box containing

DogInstance :pomerrian

It does not make sense to show the breeds of dogs represented as sub classes as it is not required to have a different behavior for suD.
Since the suD is expected to be extensible, we can't expect new class added for each new breed.

Thinking on the database side, I am considering to have a single table for "Dog" with a column as "breed".

So, can the domain objects in the assignment be shown as class instances in class diagram?

 
Vijaykumar Dixit
Ranch Hand
Posts: 32
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds a bit confusing. Your original domain model and requirements are the only guide in this case.
 
Nilessh Ganu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vj Dx wrote:Sounds a bit confusing. Your original domain model and requirements are the only guide in this case.


Vj Dx, thanks for responding.

The domain model in the assignment are shown with some example breed types. More breed types would be added later.
The requirement of suD do not expect different behavior for each of the breed classes. So I don't want to use sub classes for each breed type.
So simply showing the instances of Dog class would suffice.

Since I saw people in the forum suggesting to depict all the domain objects in the class diagram, I am in dilemna to show them as class instances.

Hope I have not confused you further.


 
Nilessh Ganu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I am not able to properly simulate my assignment details here...
Reducing it to a single question:

As mentioned number of times in the forum for showing the domain objects in the class diagrams, can I show them as class instances of a generic class if it is really mandatory??



 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That seems reasonable. It's hard to say for sure.
 
Ana Gari
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I got the same thought as you, but don't dare to implement. I am in the middle of my assignment
Have you shown Calssname: instancename in your class diagram to mirror the domain model.

Thanks for your response in advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic