ejb mvc structure

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!

[551 byte] By [zhebincong] at [2007-9-27 20:57:26]
# 1
IMO , session bean components are not used as controllers. They are mostly used as a facade to the system.--Ashwani
ash_k at 2007-7-7 2:37:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

thanks

you are right,what i mean is to decouple the web tier and the ejb tier.

in web tier,i can ONLY look up the session bean controller that is the facade of the business session bean models instead of looking up the business session beans individually,when the business tier is changed,i don't need to modify the web tier if only the session bean controller keep unchanged,the session bean controller is in charge to direct the different command that come from the web tier to the business session beasn acordingly,it makes the dcvelopement and modification convenient.

do you have such an experience?and where can i find the sample code of such session bean controller?or can i get it from the petstore application?

thank you!

zhebincong at 2007-7-7 2:37:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Hi zhebincong,

There are a lot of java files to be created other than Session beans namely DAO objects and their implementations where u do the lookup of the EJB. As all DAO objects does EJB lookup, u can use a simple servlet which uses Service Locator design pattern. Next there are ProcessController files which delegates request to different java objects created etc etc. The list goes on and on.

Please go to another forum "Design Patterns" for the same. There is a pdf version which supports this MVC architecture. If you want more details of the same and files involved, please send me a mail to seetesh.hindlekar@silverline.com.

Hope this helps,

Seetesh

seeteshh at 2007-7-7 2:37:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
Hi,Check out this link. http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.htmlTo abstract the client from the middle tier, Business Delegate and Service locator patterns are used.--Ashwani
ash_k at 2007-7-7 2:37:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...