hello
i am familiar with the mvc structure in the web layer,but i wonder how can i implement the mvc struction in the ejb layer.
i can use the stateless session bean as the controller,but in the web layer,i can use the url to identify the different request,and path information,but in the ejb container,it seem like there isn't such machanism,how can the controller(session bean) reforward the different request?where can i find the sample code of the sessin bean controller?is it included within the petstore?
thank you!
-
the mvc structure within ejb layer (5 messages)
- Posted by: zhebin cong
- Posted on: October 04 2002 23:17 EDT
Threaded Messages (5)
- the mvc structure within ejb layer by Suresh Devaravar on October 05 2002 00:36 EDT
- the mvc structure within ejb layer by zhebin cong on October 05 2002 05:06 EDT
- the mvc structure within ejb layer by Lasse Koskela on October 07 2002 04:41 EDT
-
the mvc structure within ejb layer by Larry Linville on October 07 2002 02:34 EDT
- the mvc structure within ejb layer by zhebin cong on October 08 2002 12:45 EDT
- the mvc structure within ejb layer by zhebin cong on October 05 2002 05:06 EDT
-
the mvc structure within ejb layer[ Go to top ]
- Posted by: Suresh Devaravar
- Posted on: October 05 2002 00:36 EDT
- in response to zhebin cong
Paass the request to Servlet as controller ,then servlet pass the request to Java Class(JavaBean)as Service class , in the service class will look up call call the Stateless Session Bean.Set the attributes in Service class then forward request to JSP.This pattern ur using in current project.
Suresh Devaravar -
the mvc structure within ejb layer[ Go to top ]
- Posted by: zhebin cong
- Posted on: October 05 2002 05:06 EDT
- in response to Suresh Devaravar
hello
what you have mentioned is still web layer mvc structure,do you hear of the ejb layer mvc structure?
i find it from a book,but i can't remember the name of the book,this book don't give me the detailed description and code sample,what i have remembered is that it use the STATELESS SESSION BEAN as the controller,the controller forward the request to the processing model just like the web layer mvc structure,i think it is the better structure to the ejb layer,it can decouple the web layer and ejb layrer.but i can't find the sample in the real world.i think the session controller should be some thing like a session facade to hide the other session facade.but this is only my guess,i don't know if there is the standard model for the ejb layer mvc structure,or maybe it is only a alias to the session facade. -
the mvc structure within ejb layer[ Go to top ]
- Posted by: Lasse Koskela
- Posted on: October 07 2002 04:41 EDT
- in response to zhebin cong
I wonder how you can implement the View part of MVC using EJBs :)
It is a common practice to use SBs as controllers for the entity beans or data access objects (model).
The basic idea is that the SBs provide a coarse-grained interface to the underlying more fine-grained logic. -
the mvc structure within ejb layer[ Go to top ]
- Posted by: Larry Linville
- Posted on: October 07 2002 14:34 EDT
- in response to zhebin cong
Sounds like you want something like the EJB Command pattern -- which I believe is documented in the EJB Pattern Book that's found in the "Books & Articles" section of the site.
In simplest of terms.. you have a Controller Session Bean (often a Stateful SB) that accepts a Command or Action class. This class typically has the logic for executing a particular action or usecase --- so it will generally know what beans, etc.. should be called and in what order. In this scenario the Controller SB would simply execute the Command / Action.
You had mentioned the petstore.. I believe that the petstore also uses the pattern, or did so at one point (I havent looked at some of the more recent versions).
Now this pattern does have its drawbacks. If your primary concern is decoupling the bus and the pres/web tiers than using a combination of a business delegate(s) and session facade(s) would give you a clear separation. I personally favor the business delegate / facade approach.
-
the mvc structure within ejb layer[ Go to top ]
- Posted by: zhebin cong
- Posted on: October 08 2002 00:45 EDT
- in response to Larry Linville
thanks
that is what i want,maybe the mvc is not the qppropriate title.