This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

shopping cart items (ref Petstore)

 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • 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
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic