EJB Design Patterns Book Question

I have been recently reading the EJB Design Patterns book by Floyd Marinesu.
In one of the earlier chapters he says that 'entity beans are transactional creatures, each method call on an entity will require a separate transaction ..'.
Surely this is wrong, if you are using CMT and mark your method transaction attribute as Required then if the calling bean has a transaction the called bean will use that transaction, rather then requiring a separate transaction.
Someone please explain.

Quoted out of context, the statement seems to be incorrect in some cases. IMO, the fact stressed is the "synchronization of the remote entity", which might have been loosely associated with a separate transaction.
Here's the original quote.
Furthermore, since entity beans are transactional creatures, each method call on an entity will require a separate transaction on the server side, requiring synchronization of the remote entity with its underlying data store and maintenance on behalf of the application server.
Maybe Marinescu would answer that better :-)

Similar Messages

  • EJB Design Patterns

    I picked up "EJB Design Patterns" by Floyd Marinescu. As I started reading through the book I began to wonder if these were standard patterns. So my question is this. Are the patterns described in this book accepted standards for design EJB's?
    Thanks

    Hi,
    You can check out the Core J2EE patterns at
    http://java.sun.com/blueprints/corej2eepatterns/index.html
    and also some examples and other strategies as applied in an application at
    http://java.sun.com/blueprints/patterns/catalog.html
    The Core patterns would be considered as the standard patterns and would probably help quite a bit.
    hope that helps,
    Sean

  • How can I develop a web application using EJB design pattern?

    I have searched over the web and found quite a lot of tutorials on how to use the EJB design pattern.
    I know that there will be a home interface, EJB object interface and a SessionBean.
    But the tutorials often only cover a single class, this made me unable to get a complete picture of how EJB design pattern can be implemented into a whole system.
    I am now required to devleop an online shopping web application using EJB and JSP page.
    I think I will need to create a lot of classes: Member, ShoppingCart, Product...etc.
    What I want to ask is that, do I need to create a home interface, EJB object interface and a SessionBean for each of these classes?
    I really need some ideas on how to develop this system using EJB + JSP pages.
    Many thanks to you all.

    For every EJB that you want to create, you will need to code a home and remote interface and a bean class.
    You could start getting your ideas here
    http://www.theserverside.com/books/wiley/masteringEJB/
    http://www.coreservlets.com

  • Where to put EJB design patterns?

    Im considering where to put the EJB design pattern classes and files.
    i.e. Facade, Data Access Objects, Transfer Objects, Delegate...
    I was thinking since the EJB business logics and implementation should be hidden from the user, then it is more logical to place these classes at the webapp.war inside of the ejb.jar.
    What are your thoughts guys?

    Photoshop patterns and normally stored in sets the set files have an extension of .pat.  You may also add individual patterns using menu Edit>Define Pattern.  In some Photoshop Pattern dialog you will see a little gear icon to open a Fly-Out menu in that menu there is a entry for Photoshop Preset Manager.  The are also other ways to get into the Preset manager.   In the preset manager you can manage many types of presets. Using its pull-down menu select patterns.  You can Load an save patterns sets.  To save a set tou heed to hilifht the paterns yoy want to include in the set.  You can also delete and rename patterns.

  • Recommend design pattern books

    Hi
    I work at a university and I am looking for some books on design patterns in LabVIEW, preferably for 2009.
    I am interested in state machine and master/slave design and perhaps also producer/consumer design pattern.
    Can you recommend some books on these techniques.
    Simon
    LabVIEW 8.6 / 2009 / 2010
    Vision Development Module 8.6 / 2009 / 2010
    VBAI 3.6 / 2010

    The LabVIEW Style Book by Peter Blume has a chapter devoted to discussing patterns in LV.  If you want to go generic and not pin yourself to one language, the classic of the subject is Design Patterns by Gamma, Helm, Johnson & Vlissides - that book has been on my shelf ever since I used it as a textbook over a decade ago.
    Greg
    Certifed LabVIEW Developer

  • Suggest good book for J2EE Design Pattern.

    Is there any good book for J2EE Design pattern? I know Head First Design Pattern book, but is focuses oncore java. I want to learn in detail with examples J2EE design pattern.
    Please suggest good books.
    Thanks in advance.
    Rahul.

    most j2ee patterns are discredited now. they were mostly workarounds for deficiencies in ejb 1 & 2 specs.
    "core j2ee patterns" is your best bet, but take it with a grain of salt.
    better to learn spring, IMO:
    springframework.org
    %

  • What is command design pattern? what is the problem that it solves?

    Hi i have been reading few articles on command design pattern but was unable to understand what it is and what problem does it solve. As far as my understanding goes if there is a pre specified method in an object that could execute and perform the necessary activities then it is called as command design pattern. Why is it named as command design pattern, it is because in a shell we use commands to retrieve output. For example when we type "dir" in dos command prompt it returns the list of files. so here we have to remember a preexisting exe file named "dir" which does something when used. So here like we call it command because when "dir" is passed to the computers it returns something that is expected. may be the computer obeys the command issued and return something back. So like wise if there is a method that is defined as as the command, for example in struts framework the action class must have a method "execute()" which is called by the framework to execute the necessary action mapped to it. So if there is a predefined method like "execute" in struts then the object is said to be followed command design pattern. So what actually does it solve?
    What ever i have written is my understanding from the articles i have read about the design pattern. So kindly correct me if i am wrong. Help me understanding what actual problem does this pattern solves. Thanking you in advance.

    This is really off-topic for these forums. You might do better on StackOverflow.com. I'll just say that although the first Design Patterns book came as a revelation to me, it was more for (a) the nomenclature (decorator, factory, facade, etc) which is still with us and (b) about five of the original patterns, which told me things I didn't already know. I've never used any of the others, including Command, and the whole design patterns thing quickly degenerated into farce with what seemed like a sustained attempt to reduce the whole of computer science to design patterns, which really isn't the point. As an example, there is one in another book called Type Object, which is nothing but 3rd normal form, which can be defined roughly in a couple of sentences. This pattern went on for dozens of pages with a very artificial example. I wrote to the mailing list about it: 'Type Object considered hilarious'. I got a rude reply from the original author, which I guess I expected, but also an incredible response from the list owner, saying I should recast my objections in the form of a design pattern. That lost it for me. True story. Moral: don't take this religion, or any IT religion, too seriously. They come around every 18 months or so with the regularity of the next bit of Moore's Law. I've seen dozens of them come and go since 1971, all with something to say, all 90% nonsense.
    See here for a longer version of this incident.

  • EJB and Design Patterns

    Hi all,
    Which design patterns could be applied in coding EJB? I don't know if my question is clear enough, but what I really want to know is which design patterns I could use with EJB and how could I use them this way? (Some example situation)
    Regards,
    Filipe Fedalto

    i think it depends of what u intend to do..
    e.g. i think (maybe i'm wrong, any relevant replies are welcome!) that u could use a stateless session bean to implement some facade, delegating entities creation to some non-bean classes? or why not a stateful session bean to implement a factory (when entities creation depend on client preferences)?

  • Design Patterns w/o EJB

    Greetings, I am attempting to build a JSF application while learning JSR 127 and a few of the J2EE design patterns. The problem that I am having is that I don't plan on using EJB/Spring with my project and many of the tutorials I have been able to find place a focus on the EJB/Spring implementation details which are both overkill for this project. That said, I want to learn the appropriate patterns to build a functional application without catching "pattern fever".
    I have a general idea of some of the patterns I need to use to get from the presentation tier to the data tier, such as Business Delegate and Data Transfer Object. However, I'm not sure I understand how to use these in conjunction with the managed beans facility. Do the managed beans contain (as in composition) the Business Delegate objects? Or do I use a DTO to push the data from the managed bean to the Delegate? How much if any logic do I put in the managed beans if I'm using them in this fashion (or are they basically just fields and getter/setters)?
    All comments or suggestions are sincerely appreciated,
    Jon

    Hi,
    Have you taken a look at Java BluePrints Solutions Catalog:
    https://blueprints.dev.java.net/bpcatalog/
    The Solutions Catalog focuses on different topics specifically so that you can pick and choose which articles are most interesting to you.
    -Larry

  • RE: design patterns involving EJBs and JDO

    Is the idea that you specify in some config file (xml?) the methods of
    your session bean, whether its stateful or stateless, the default bean
    transaction semantics, etc, then say "go" and it generates the home and
    remote interfaces and the skeletal session bean class?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:26 AM
    To: JDO-ListServ
    Subject: Re: design patterns involving EJBs and JDO
    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----
    From: Matthew <mailto:[email protected]> Adams
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated.
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric

    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----_
    From: Matthew <mailto:[email protected]> Adams_
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated._
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric_

  • Re: EJB Design Question

    Hi All,
    I am developing an application based on MVC design pattern in which the servlets
    is the main controller . I am planning to use session beans to access the database
    rather than making direct JDBC calls from the servlet.
    The Session bean would use a connection from a pool and return it back when its
    done with it.
    My question is if there are multiple users accessing the servlet then would there
    be different connection objects and each client would start a new thread/
    Also is there any problem with the above design ?
    Thanks...Kevin

    View - JSP Or Servlet
    Controller - Servlet
    Model - Java Bean
    Session Bean - Facade for Workflow
    Entity Bean - Persistence and Business Logic
    Also look at
    www.theserverside.com
    My question is if there are multiple users accessing the servlet then would
    there
    be different connection objects and each client would start a new thread.
    -Servlets are multithreaded (unless you are using the single threaded
    model). For example you might get a call on doGet() while another is being
    processed on the servlet instance. If you make sure that all you resources
    (session beans, connections etc) are created and destroyed within the
    lifecycle of the doGet() you are safe. All shared data (like session data)
    should be made thread safe.
    "Kevin" <[email protected]> wrote in message
    news:3cb59182$[email protected]..
    >
    Hi All,
    I am developing an application based on MVC design pattern in which theservlets
    is the main controller . I am planning to use session beans to access thedatabase
    rather than making direct JDBC calls from the servlet.
    The Session bean would use a connection from a pool and return it backwhen its
    done with it.
    My question is if there are multiple users accessing the servlet thenwould there
    be different connection objects and each client would start a new thread/
    Also is there any problem with the above design ?
    Thanks...Kevin

  • A good book on design patterns?

    Hi there. Just wondering if anyone could recommend a good book on design patterns, for someone who's relatively experienced at the nuts and bolts of programming in a few languages, but hasn't really considered design patterns before? Someone recommended Gamma et al's, 'Design patterns: elements of reusable object-oriented software' to me, but it is perhaps a little dated now. Any thoughts?

    Surprisingly, no one posted the link to the Sun J2EE Pattern blueprints:
    http://java.sun.com/blueprints/corej2eepatterns/index.html
    I also liked the O'Reilly publication "J2EE Design Patterns"
    They are specific to J2EE architecture, but there's a lot of reuse available even if that's not the architecture you're working with.
    Brian

  • [BOOK] What's the best book about DESIGN PATTERN

    Hi Guys,
    by experience, what's the best book for you concerning the Design Pattern in Abap. I mean :
    Quality,
    Comprehensiveness,
    Clearness,
    Amount of chapter,
    etc.
    Thank for advices.
    Rachid.

    Dear Rachid,
    This is rank 1 book, but u have learn online also. So many websites are there. example search: OO Design patterns ZEVOLVING.
    Regards,
    Abbas.

  • Book Review: A Serious Guide to OOP Design Patterns

    I've just finished reviewing a new book: AdvancED ActionSpript 3.0: Design Patterns by Ben Smith, published by Apress as part of the Adobe Learning Library
    I liked the book very much and I wanted to share my discovery with those of you who (like me) would like to bring the advantages of Object-Oriented Programming and Design Patterns to your Flash/AS3 application development efforts.
    I posted my review (“A Serious Guide to OOP Design Patterns”) on Amazon just the other day. Take a look at my review and browse through Mr. Smith's book—if you're interested.

    Nikimathew wrote:
    Every now and then I ask people if they are familiar with the book, Design Patterns: Elements of Reusable Object-Oriented Software. On such occassions, I'm often surprised to hear someone respond, "Yes, I've read it." Having spent close to three years running a study group devoted to understanding the subtleties, combinations and variations of the patterns in this book and others, I am often compelled to ask these individuals if they actually believe that the book can be "read" rather than "studied"? trolling for new members?
    three years? c'mon. i love the GoF book, but it's not holy writ. and it hasn't saved object-oriented software development.
    sounds like you need to move on to a new topic. go buy another book.
    %

  • Design Pattern / Best Practice Question

    Hi,
    I have been using Flex for a while now, but there is a
    scenario which I still have not found a solution I'm entirely happy
    with. I'm wondering if anyone else out there might have suggestions
    on a design pattern or best practice.
    Suppose I have a view which depends on model data which
    resides in some back end systems. That model data may or may not
    have been loaded (e.g. via a web service or remote object call) at
    the time the view is displayed.
    I don't know if the user will ever visit this part of the
    application so I would prefer to defer retrieval of the data until
    the user actually navigates to this view. Or I want to retrieve the
    data each time the view is displayed because the data is dynamic
    and could change between one presentation of the view and the next.
    Because the data comes from several systems, I cannot simply
    make one service call and display the view when it completes and
    all the data is available. I need to call several services which
    could complete in any order but I only want to display my view
    after I know all of them have completed and all of the model data
    is available. Otherwise, I can present the user an incomplete view
    (e.g. some combo boxes are empty until the corresponding service
    call to get the data completes).
    The solution I like best so far is to dispatch a single event
    (I am using Cairngorm) handled by a single command which acts as
    the caller and responder for all of the services. This command then
    remembers which responses it has received and dispatches another
    event to navigate to the view once all the results have returned.
    If the services being called are used in different
    combinations on different screens, this results in proliferation of
    events and commands. An event and command for each service and
    additional events and commands to bundle the services and the
    handling of their responses in the right combinations for each of
    the views.
    Another approach is to have some helper class listen for all
    of the model changes and only display the view when the model
    enters some state that is acceptable. It is sometimes difficult to
    determine just by looking at the model whether it is in the right
    state (e.g. how can I tell that a collection is the new collection
    that should just have been requested versus an old one lingering
    from a previous call). The logic required can get kind of
    convoluted and brittle.
    Basically, all of the solutions I've come up with so far seem
    less than ideal and a little hackish. I keep thinking there is some
    elegant solution out there that I am just missing ... but so far,
    no luck finding it. Thoughts?
    Thanks.
    Bill

    i think a service class is right - to coordinate your calls.
    i would have 1 event per call (so you could listen to individual
    responses if you wanted to).
    then i would use a flag. if you want to check for staleness,
    you would probably want two objects to map your service flag to
    lastRequested and lastCompleted. when you check, check if it's
    completed, and if it's not stale and that your lastRequested is
    less than lastCompleted (meaning that you're not currently waiting,
    i.e. you've returned since making a request). then make the request
    and update your lastRequested.
    here's a snippet of what i mean.
    ./paul
    public static const SVC1_LOADED:int = 1;
    public static const SVC2_LOADED:int = 2;
    public static const SVC3_LOADED:int = 4;
    public static const SVCALL_LOADED:int = 7;
    private var completedFlag:int = 0;
    then each call would have it's own callback.
    private function onSvc1Complete( evt:Event):void {
    completedFlag |= SVC1_LOADED;
    lastCompleted[ SVC1_LOADED ] = getTimer();
    dispatchEvent( new Event("svc1complete") );
    checkDone();
    private function checkDone():void{
    if( completedFlag == SVCALL_LOADED )
    dispatchEvent(new Event( "allLoaded" ));

Maybe you are looking for