This content has been marked as final.
Show 2 replies
-
1. Re: Entity/Session bean coupling
pmuir Jan 6, 2008 4:44 PM (in response to parszab)"parszab" wrote:
It seems to me, however, that this way my Sesson beans have to be to closely coupled to the web UI, and won't be available to be called from the Swing UI.
Not really, you just need to separate the concerns of your app properly (this is a case when some layering would be beneficial).Entity beans contain data about the contexts, that's no more that a bit disturging, since the swing clients can simply ignore that.
They certainly don't have to (and I prefer they don't, this was something we experimented with early on and have since swung away from, preferring to manage the entity beans using a Seam manager component like EntityHome and a factory).But the session beans returning FacesMessages, and string values to manage the page flowm in and outjecting etc. -- that is too close coupling for me.
So, keep your business logic in e.g. EJBs, and provide two facades, one for Web apps using Seam and one for Swing using whatever you want. (Btw Seam doesn't really support Swing at all as a front end). -
2. Re: Entity/Session bean coupling
parszab Jan 7, 2008 2:47 PM (in response to parszab)"pete.muir@jboss.org" wrote:
"parszab" wrote:
Entity beans contain data about the contexts, that's no more that a bit disturging, since the swing clients can simply ignore that.
They certainly don't have to...
Good to know, thanks! I guess "@Name"-s might be still necessary in some cases, though..."pete.muir@jboss.org" wrote:
So, keep your business logic in e.g. EJBs, and provide two facades, one for Web apps using Seam and one for Swing using whatever you want. (Btw Seam doesn't really support Swing at all as a front end).
If I'm right that means the introduction of an Action layer for the web UI. That bothers me only because this way I'll lose the availability of attached Entity beans. In this scenario PersistenceContext should go into the Session beans and not the Action POJOs. That is acceptable, but a bit said to sacrifice one of Seam's great advantages for pure design. :)