This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Can the domain objects be shown as class instances in 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,

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?

 
Ranch Hand
Posts: 32
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??



 
author & internet detective
Posts: 41185
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That seems reasonable. It's hard to say for sure.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic