Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Inheritance usage in UML

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am working on Gemstone International assignment, in the given business domain model, they have provided
1. Buyer and Supplier
2. SellOrder and BuyOrder
3. SemipreciousStone and PreciousStone ( again 3 sub classes for each of these two)

Practically I would go with a super class example User and have 2 subclasses Buyer and Supplier. One parent class Order with child classes SellOrder and Buy Order and  One superClass Stone, then 2 subclasses Precious and SemiPrecious and gain 3 sub classes for these two.

But as they have given them as separate classes with out parent class (User,Order,Stone) , I doubt if I am on right track, I mean is my thought process right or do I have to just go a head with provided classes as is?
And one more question is: If I take super class Order with some attributes stoneName,qty,price and orderType where orderType refers to an Enumeration with {"Sell" ,"Buy"} so the difference between the 2 child clases buyOrder and SellOrder is only the attribute value of orderType. In that case do I really need 2 subclasses, with out having any new attributes/operations on top of parent class?
I really appreciate your inputs here. Thanks in advance.

Aparna Mudireddy
mudireddi.aparna@gmail.com
317 263 4653
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic