File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Writing Controller Logic in Managed Bean-JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Writing Controller Logic in Managed Bean-JSF" Watch "Writing Controller Logic in Managed Bean-JSF" New topic
Author

Writing Controller Logic in Managed Bean-JSF

Shaiju scientia
Greenhorn

Joined: Jan 17, 2006
Posts: 15
Hi,
I am a newbie in JSF. I am using JSF1.2 (MyFaces). What confusing me is writing the controller logic inside the ManagedBean.It seems that ManagedBean would be my domain objects.Writing the controller/business logic inside my domain/business object is not a good idea.Is there some thing I got wrongly ?
Can anybody give a point?

Shaiju
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

Well, your managed bean is really tied to your web layer, so it is a web centric artifact.

A managed bean will often pass data to a domain object once the data has been converted and validated, but the managed bean itself should not go beyond the web layer. I mean, you wouldn't want to pass a JSF managed bean to a DAO or anything like that.

JSF --> Managed Bean --> Domain Object --> DAO --> Database

That's a common transfer of data and control in a simple application.

-Cameron McKenzie


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Writing Controller Logic in Managed Bean-JSF
 
Similar Threads
Business Logic in JSF
what stereotypes are allowed in class diagrams
Controller to Service Layer
doubt in design patterns
Need help in desgining the application.