Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Inheritance usage in UML

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic