3

Backround to the problem: I have connected two classes to each other in UML, both of them being regular classes and one of them is named "League".

In the "miscellaneous" menu in MDriven, I found that the following “EffectiveName": "League_children” as well as "OtherEnd": "League_parent".

This was confusing in three ways:

  1. There is not a class named "League" in "OtherEnd"
  2. The terms "League_children” and "League_parent" were created automatically
  3. It says "League_children" not "LeagueChildren" with the latter one I thought was more correct becuase of how you write in code, and also everywere else in the diagrams and menus in MDriven's workspace.

I read about the terms "children" and "parent" in the official book (https://www.capableobjects.com/xdownloads/MDrivenTheBook/MDrivenTheBook-Part2-Design.pdf ) and obviously these are used when you have superclasses and subclasses to those. However, neither "League" or any other class in my diagrams as of now are superclasses", so why are these names created then?

Furthermore, "OtherEnd" is not called "League" and therefore shouldn't have be called "League_parent".

I searched through my different classes and found no hidden associations that I had acidentally/falsely deleted.

1 Answers1

3

I recognize the _Parent _Children pattern as what MDriven does when adding an association from a class back to the same class.

If you check the Class in the tree I bet you will find an association pointing back to self. If this was added by mistake - delete it.

Normally MDriven leaves the name of association ends blank - then the effective name will be the name of the Class in the end. Name - if set - overrides this.

When creating associations back to self - MDriven sets the names of the ends appending _Parent and _Children.

Hans Karlsen
  • 2,275
  • 1
  • 15
  • 15
  • But not every "recursive association" represents a parent-children relationship type. Especially, if they're not one-to-many. Therefore, the default naming pattern _Parent _Children is not good/intuitive. – Gerd Wagner Jan 26 '18 at 07:35
  • I agree with @GerdWagner - but as the default association-cardinality in MDriven comes out as one to many - the Parent Child pattern fits this default. The alternative to leave the naming blank would cause an error of conflicting association-end names. Anyway - names are easy to update once added. – Hans Karlsen Jan 26 '18 at 09:22
  • But why don't you use the lower-cased (and possibly pluralized) names of the participating classes as the default names of association ends (and the corresponding reference properties)? Like "customer" and "orders" in the case of a one-to-many association between `Customer`and `Order`? – Gerd Wagner Jan 26 '18 at 18:19
  • @GerdWagner - we do use the target class as the default name - and if it is a multilink and the owning package has PluralSuffix="s" it will be "target"+"s"->"Targets" The default naming was however commonly reported as a problem when linking back to self (specially if the pluralsuffix was empty) – Hans Karlsen Jan 27 '18 at 15:20