Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question regarding the business model in part 2 and assuming objects inherit from a class

 
Andres Olarte
Ranch Hand
Posts: 46
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on part 2, and I have a question regarding the business model:

Two classes are defined, and most of the operations occur on one of these two classes. According to the business model, they do NOT inherit from any common object. However, this is causing a lot of duplicate logic to Class1 or Class2, when the design would be much more elegant if the both inherited from a hypothetical "ParentClass" (which is not listed in the business domain model diagram).

Can I make the assumption (and document such assumption) that these two classes inherit from a "ParentClass" no listed in the business domain model? The assignment is also very geared towards integration, and I assumed that this business model was coming from one of the Java systems that I have to integrate with, which might mean making changes to the domain model more questionable. What do you guys think?

Thanks
 
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
You can change the business model if you can justify it. Maybe sure this ParentClass is a business concept and not just a helper. For example, if they gave you Pen and Pencil, introducing WritingInstrument is perfectly reasonable. If the classes aren't related enough, you can always use a utility class or singleton or contained class for the common code.
 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion adding the parent class should be always allowed but note which Inheritance strategy (Single table, Concrete table, Class table) will you implement. Also naming the class correctly is an art and should be done carefully.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic