[jboss-user] [EJB 3.0] - Re: SLSB basic design question

2008-08-18 Thread PeterJ
Of course an alternate approach is to go back to what was done with EJB 2.x to support unittestability - place all of the methods into another object, and make the SLSB a mere facade for that object. Then each SLSB method would look like: void doSomething(int var) { new RealObject(var).doSome

[jboss-user] [EJB 3.0] - Re: SLSB basic design question

2008-08-18 Thread vanyatka
Thanks for sharing your insights on this issue! "ALRubinger" wrote : Sure, but you've set up a maintenance "gotcha" that is pretty easy to violate and will be difficult to debug. Also, you'll be less likely to see the inconsistencies exhibited in development, meaning it's likely that Peter's

[jboss-user] [EJB 3.0] - Re: SLSB basic design question

2008-08-18 Thread ALRubinger
"vanyatka" wrote : ...if I only run one single facade method, and previous old state doesn't bug me (all variables are re-initialized before used), can such "temporal" use of fields be justified? Sure, but you've set up a maintenance "gotcha" that is pretty easy to violate and will be difficult

[jboss-user] [EJB 3.0] - Re: SLSB basic design question

2008-08-18 Thread vanyatka
"ALRubinger" wrote : SLSBs *do* have state, as the instance is returned to the Pool after use. Therefore invocation-specific data should not be kept in instance members of a SLSB. Thanks, Andrew. This makes good sense. However, if I only run one single facade method, and previous old state do

[jboss-user] [EJB 3.0] - Re: SLSB basic design question

2008-08-18 Thread ALRubinger
Peter is right, though for the wrong reason. :) SLSBs *do* have state, as the instance is returned to the Pool after use. Therefore invocation-specific data should not be kept in instance members of a SLSB. For SFSB this is acceptable (and good practice) because it's guaranteed that every sub

[jboss-user] [EJB 3.0] - Re: SLSB basic design question

2008-08-18 Thread vanyatka
"PeterJ" wrote : With an SLSB multiple threads can be using it simultaneously Huh??? What about SLSB pools then? I was sure that a thread takes SLSB instance from the POOL, executes it and returns it back for later use. Never two threads execute on the same SLSB instance. View the original pos

[jboss-user] [EJB 3.0] - Re: SLSB basic design question

2008-08-18 Thread PeterJ
Always pass values as method parameters - do not use fields. With an SLSB multiple threads can be using it simultaneously and if you use a field you will get "interesting" results. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171094#4171094 Reply to the po