| Author |
Topic  |
|
|
support
Moderator
    
5503 Posts |
Posted - Jun 26 2012 : 11:38:06 AM
|
Which Composition graph best represents the following code? (looking for personal preferences)
Where spaghetti "IS" pasta that "HAS" meatballs and sauce.
 |
Edited by - support on Jun 26 2012 4:59:06 PM |
|
|
accord
Moderator
    
United Kingdom
2251 Posts |
Posted - Jun 26 2012 : 12:27:24 PM
|
| I would say B |
 |
|
|
jschroedl
Ketchup Master
   
USA
54 Posts |
Posted - Jun 26 2012 : 1:20:49 PM
|
| I would say D |
Edited by - jschroedl on Jun 26 2012 8:30:19 PM |
 |
|
|
rhummer
Tomato Guru
    
USA
527 Posts |
Posted - Jun 26 2012 : 4:29:14 PM
|
| I would say C |
Tools Engineer - Raven Software VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64
|
 |
|
|
support
Moderator
    
5503 Posts |
Posted - Jun 26 2012 : 5:00:29 PM
|
| EDIT: Added option "D" above. |
 |
|
|
feline
Moderator
    
United Kingdom
12804 Posts |
Posted - Jun 26 2012 : 7:40:27 PM
|
| Of the 4 options, just looking at the pictures on their own, and thinking about code structure, I would say A is my preferred option. But to try and represent the statement, definitely B, which better reflects what is happening. |
zen is the art of being at one with the two'ness |
 |
|
|
StefanEgo
Senior Member
  
45 Posts |
Posted - Jun 27 2012 : 03:38:26 AM
|
| B :) |
 |
|
|
Mike ONeill
Ketchup Master
   
South Africa
87 Posts |
Posted - Jun 29 2012 : 01:11:09 AM
|
I think B for me too
Mike |
 |
|
|
sean
Moderator
    
USA
1553 Posts |
Posted - Jun 29 2012 : 2:08:05 PM
|
A is a hard sell for me because inheritance is upside-down.
B and C are appealing because I see standard inheritance (base at the top, most derived at the bottom, with "is a" arrows in the direction I expect them to be).
D is growing on me but I have to mentally change the meaning of the arrows from "is a" and "has a" to "is the base of" and "is in." And an additional disconnect because it uses the same link colors as "is a" and "has a."
The question "Is water used in spaghetti?" for me is most easily answered by D but I'm not sure how often that question matters. |
Whole Tomato Software
|
Edited by - sean on Jun 29 2012 2:12:41 PM |
 |
|
|
mwb1100
Ketchup Master
   
77 Posts |
Posted - Jul 09 2012 : 1:35:48 PM
|
I would also say B.
However, I think it would be even better if the "HAS A" link were more like the UML aggregation link for displaying the relationship between "Spaghetti <>--- Meatballs" and "Spaghetti <>--- Sauce".
I know that this wouldn't be perfect (the tool probably couldn't reasonably distinguish between aggregation and composition, for example), but I think displaying links more like UML lets the diagrams be more readily understood at first glance by someone, since UML is a widely documented and used diagram standard. Even if the diagrams aren't full-blown UML, using UML where there's reasonable UML to be used will make the diagrams less confusing. Why invent your own diagram 'language' when there's one already out there? |
 |
|
|
feline
Moderator
    
United Kingdom
12804 Posts |
|
| |
Topic  |
|