• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

SCEA part 2. Strange domain model

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,


Currently I hav an assignment with strange relations among object (see attachment as example) - many-to-many. Can I in class diagramm introduce additional classes between 2 objects to chane relationshit to one-to-many and many-to-one?


Class-Diagram0.jpg
[Thumbnail for Class-Diagram0.jpg]
Domain model
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I could understand from UML Distilled, you can do this, but my question is another, as I am also in the situation of adding this in my solution, does it really make sense to do this? In my situation, for example stepping into the relation with another class, has no real logical value added, as it acts become like a mirror between the ends, and, hence, I would still rather see the relation as 1 to 1 or many to 1 at most.
What assignment do you have?
 
Kiril Nugmanov
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a Gemstone International. Generally I think such model could confuse - if there is many-to-many its better not to display such relationship (it won't confuse any one).
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kiril - Is it Goods or Type of Goods? This makes sense if it is "Type" and not the actual Goods items.
 
Kiril Nugmanov
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
san kumar parihar:

As I understood it Goods. There can be several types of goods but all they extending base class Goods. So between Order and Goods I introduces OdrerEntry which contains specific Good prams like quantity, color etc.
 
san kumar parihar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope I am not oversimplifying your problem but what you are saying is - Order can have many OrderEntry, and OrderEntry is described by a Type of "Good".
You refactored your model from:
Order -> Goods Type (* to *)

TO:

Order-->OrderEntry (1 to *)
OrderEntry --> Goods (* to 1) [As one Goods Type can describe multiple OrderEntry]

This is more or less similar to Figure 1 and Figure 2 as explained by Scott Ambler (see "Enrollment" association in link below) and seems to justify the original cardinality.
http://www.agilemodeling.com/artifacts/classDiagram.htm

Hope this helps.
 
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic