Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is EJB pooling related with flyweight pattern ?

 
Maris Orbidans
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SCEA training exam from www.javaqueries.com says that
Bean pooling allows container to use beans as flyweight.

My opinion is that flyweight pattern allows to create an object (flyweight) with some common state. All other objects have references to the flyweight instead of having many copies of a common state.

Do you see any similiarity with EJB pooling ?
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pooling is not the same as sharing. Flyweight is characterized by some of these features that are not applicable in the EJB pooling scenario -

  • A single shared objects can be used in multiple contexts simultaneously.
  • Flyweights cannot make any assumptions about the context in which they operate.
  • Shared objects are fine-grained components of a larger object.
  • A shared "in-use" flyweight instance is indistinguishable from a non-shared object instance.
  • A Flyweight's state is managed entirely by the client( extrinsic state )


  • HTH
    [ April 29, 2005: Message edited by: Ajith Kallambella ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic