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

shopping cart items (ref Petstore)

 
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The shopping cart items of petstore are used to create the order.
Until the order is created no EJB's are created. Looking at this example I am confused how we can create flight EJB or seat EJB b4 the order completion. (until the customer has completed and paid for the transaction.)

Can some one please explain this?
Thanks
Dhiren
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not exactly an answer to your question, but I think you are clearly going down the slope of "everything is an EJB". Does flight and Seat have to be an EJB?
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Not exactly an answer to your question, but I think you are clearly going down the slope of "everything is an EJB". Does flight and Seat have to be an EJB?


Thanks Ajith that does give me a direction. I thought they needed to be EJB's as I saw from varies posts and could not relate it with what I was designing.
 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ajith Kallambella:
Not exactly an answer to your question, but I think you are clearly going down the slope of "everything is an EJB". Does flight and Seat have to be an EJB?



Hi Ajith,

I see your point that "not everything qualifies for an EJB".

But I think Flight is definitely a "Business Object". Whether it gets implemented as a remote entity bean, local entity bean or a simple bean could be debatable.

For example: if down the road, the system requires some maintenance modules for maintaining/publishing flight information then planning a "Business Object" called Flight or FlightDescription helps.

In Petstore, the famous "Customer" diagram depicts 5-6 different objects. Sun implemented all of them as Local Entity beans. May be just 2 or 3 objects would have met the requirement.

regards,
Deepak
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajith/Deepak
On the same track I tried to find who creates the shoppingCartModel.
I couldnt find a single reference and I always thought that would be some session bean doing it.
Can anyone who has loooked in petstore in detail give me some inputs on this class and its creation .

Thanks
Dhiren
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dhiren,

No I have not explored Petstore to such depths.

regards,
Deepak
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Deepak Pant:

But I think Flight is definitely a "Business Object". Whether it gets implemented as a remote entity bean, local entity bean or a simple bean could be debatable.



Sure, Flight is a business object. As you have rightly said, modeling every single business object as an entity bean is actually an antipattern. While crossing the chasm between design and implementation, one has to consider other alternatives such as POJOs and coarse grained entity beans.
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ajith Kallambella:


Sure, Flight is a business object. As you have rightly said, modeling every single business object as an entity bean is actually an antipattern. While crossing the chasm between design and implementation, one has to consider other alternatives such as POJOs and coarse grained entity beans.



Thanks for the clarification !!!. Appreciate it
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajith/Deepak,
I proceeded further and it looks to be convenient if seat is made an EJB..

any thoughts. Ajith especially remarked that one should not jump into everything an EJB then how is one to keep track of seats being taken empty etc. I couldnt figure a better way but not to keen to go for EJB becuase then I am tied to having seats reserved even if they r not paid for.

Thanks
Dhiren
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic