-
1. Re: Application Scoped Service layer
mkiel Jun 17, 2008 1:40 PM (in response to mtorres)Seam also features a stateless scope which you should probably use for your service layer:
@Scope(ScopeType.STATELESS)
As far as I know, stateless JavaBean components in Seam are pooled just like stateless EJB session beans are, so every caller gets his
own
instance. That means synchronization is not necessary and there are no performance issues. -
2. Re: Application Scoped Service layer
diegocoronel Jun 17, 2008 2:37 PM (in response to mtorres)Hey,
Is it a good approach make my facade and my DAOs stateless seam components? is there any problem ?
-
3. Re: Application Scoped Service layer
barbacena Jun 17, 2008 2:52 PM (in response to mtorres)Hi Mark,
I had your problem before and asked myself exactly the same questions :D. I was hoping to have something like stateless singletons but there isn't. Therefore I had to switch to plain stateless beans. You can that with plain Seam components or EJB.
But the good news are that EJB 3.1 will have the singleton scope. I don´t really know the semantics but I hope they put something good.
-
4. Re: Application Scoped Service layer
mkiel Jun 17, 2008 3:28 PM (in response to mtorres)That's how I do it. On the other hand, the Seam wiki example uses event-scoped JavaBean DAOs, but they don't actually have any state. As far as I understand this, there should only be very minor differences in performance and/or memory usage. (But I am quite sure that any scope other than stateless or event should not be used for these effectively stateless components.)