• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Question on JustBuildIt Corp Class Diagram

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm reading the worked out assignment in Chapter 9 of the Book - SCEA Study Guide by Cade and Sheil. I have a question on the class diagram.
The class diagram shows wood, steel and concrete as marked with @Entity. As per the problem statement, I thought the details of the inventory comes from an already existing inventory and order management system. The planned system would just consolidate the availability of these items and create bids.

I don't see any reason why we would be persisting the wood , steel and concrete to the proposed system.
My question is even if certain objects don't need to be persisted to the proposed system , but are part of the Domain model - do we need to mark them as @Entity?

Any response most be most welcome!
 
author & internet detective
Posts: 42103
933
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
I would have made AvailabilityItem and entity and not those three. I can't think of a reason either.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If AvailabilityItem is an abstract class wouldn't we have to persist wood,steel, concrete to persist availability item ?
 
Jeanne Boyarsky
author & internet detective
Posts: 42103
933
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

Saket Mittal wrote:If AvailabilityItem is an abstract class wouldn't we have to persist wood,steel, concrete to persist availability item ?


Not necessarily. Wood/steel/concrete could be a type column on the AvailabilityItem table.
 
Saket Mittal
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry unable to understand. If AvailabilityItem is abstract then to persist information in the base class I will have to instantiate wood,steel,concrete and em.persist() them. And for this to work wood,steel,concrete have to be @Entity. Right ?
 
Jeanne Boyarsky
author & internet detective
Posts: 42103
933
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

Saket Mittal wrote:Sorry unable to understand. If AvailabilityItem is abstract then to persist information in the base class I will have to instantiate wood,steel,concrete and em.persist() them. And for this to work wood,steel,concrete have to be @Entity. Right ?


If it is abstract, yes. I wouldn't have designed it as abstract was my point.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me share my views (along with my own doubts) with an example:

In case of wood, every single instance of it has a particular color, density and machineability. This is not like products which usually have predefined properties (think about soap, laptop, cars etc). In this example, characterstics classes are telling which attributes are important but who will store their actual values?

a) If Wood@Entity has to store these details, then is it modeled correctly?
b) If WoodCharacteristics stores it then why is not an @Entity class?

Please share your views because I am struggling with a similar problem.
 
Saket Mittal
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

san kumar parihar wrote:Let me share my views (along with my own doubts) with an example:

In case of wood, every single instance of it has a particular color, density and machineability. This is not like products which usually have predefined properties (think about soap, laptop, cars etc). In this example, characterstics classes are telling which attributes are important but who will store their actual values?

a) If Wood@Entity has to store these details, then is it modeled correctly?
b) If WoodCharacteristics stores it then why is not an @Entity class?

Please share your views because I am struggling with a similar problem.



If characteristics needed to be persisted then WoodCharacteristics etc would have been shown as @Entity. I think the only properties being persisted are the ones present in AvailabilityItem. Wood,Steel,Concerete are shown as entities merely because AvailabilityItem is an Abstract class.
 
Tell me how it all turns out. Here is a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic