• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

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

 
Ranch Hand
Posts: 46
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41110
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
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.
 
author
Posts: 188
11
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic