• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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
[email protected]
317 263 4653
 
reply
    Bookmark Topic Watch Topic
  • New Topic