• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Writing Controller Logic in Managed Bean-JSF

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic