[jboss-user] [JBoss Seam] - Re: Challenge: Simple Example Adding Records With Lookup Dro

petemuir do-not-reply at jboss.com
Wed Oct 25 13:31:58 EDT 2006


anonymous wrote : In Seam what are the best guidelines for determining when/when not to use SLSB/SFSB?

This is an interesting question.  I think the answer depends on style/what you are doing.

I'm increasingly using the pattern of a stateful component to manage the flow and a stateless 'service' bean to do the rest of the work.  I use bijection to pass any object required (so far only entities) between them.

The advantage of this approach I find is that, firstly, you seperate workflow logic from 'helper' methods resulting in clearer code (for example, deleting a user vs. reseting the password), secondly, it makes the 'helper' methods resuable (e.g. a nationality dropdown might be used in various places in your ui, so you want its content to be generated in a stateless fashion).

The disadvantage is complexity - and I am developing a complex workflow involving jbpm.

So, what I would do is create a 'roomService' bean which contains any non-workflow-related methods for rooms (e.g. drop down lists, generating access codes), and a 'roomCRUD' bean that contains the workflow methods.  That doesn't mean its the best approach but it works well for me and avoids a lot of the concurrent access problems to stateful beans (though I believe the new seam fixes this).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980785#3980785

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980785



More information about the jboss-user mailing list