• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cade Sequence

 
Dan Huskins
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Cade's book (p174), he shows the stateless session bean SearchProcessor in a sequence diagram getting created through a ServiceLocator. However, he only shows it getting created one time, rather than each time the customer creates an action.

Any thoughts on this?
 
Marie Pierre Courbevoie
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan

I think because SLSB from the same pool have the same object identity, the reference to the EJBObject (more accurately a reference to a Handle which is serializable)is cached somewhere .isIdentical method return always true for SLSB in the same pool. Really, the reference maps to the pool of SLSB not to a specific SLSB instance .This strategy improves performances.
Simpler: for a reference to a EJBObject, the container returns any SLSB instance from the same pool.
I hope that i'm not wrong

Marie Pierre
[ August 17, 2005: Message edited by: Marie Pierre Courbevoie ]
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,

The Browse Catalog sequence diagram shows one unique sequence of actions. In this case, it shows how the user browses the categories, chooses and a product and adds it to the shopping cart. Therefore, I can't really follow what you are saying:

However, he only shows it getting created one time, rather than each time the customer creates an action.


In addition, loops and whiles tend to make the sequence diagrams very complex. Here is what Martin Fowler says about them:

A common issue with sequence diagrams is how to show looping and conditional behavior. The first thing to point out is that this isn't what sequence diagrams are good at. If you want to show control structures like this, you are better off with an activity diagram or indeed with code itself. Treat sequence diagrams as a visualization of how objects interact rather than a as a way of modeling control logic.
That's said, here's the notation to use. Both loops and conditionals use interaction frames, ....


-- Dan
 
Dan Huskins
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,

By action i just meant the user clicking a button or link. Seems like each 'click' would represent a new web container thread; each thread would require a new SLSB.

-d
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,

If we look at the basic flow of Browse Catalog on page #160 we see steps 1 through 6. The sequence diagram shows that exactly one SearchProcessor object is used for these six steps. We can see it by the long activation bar of the SearchProcessor object.

-- Dan
[ August 17, 2005: Message edited by: Dan Drillich ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic