Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF and EJB  RSS feed

 
Dominik Müller
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi together,

i was searching a while around for the above mentioned Topic.
I am very new (in both technologies) and with my first steps to combine EJB (3.1) and JSF (2.0) i have no idea about "best practice"

Lets try to build up a very simple situation, without going in to too deep:

a very simple Entity:


Now i want to build up a simple Edit-Application. The "normal" (?) way would be to build up a managedbean, which holds the values from the form and build up such an entity and persists it (over a session bean or what else)
The "problem" is that this managedbean whould nearly like like the same, because all entity property have a gui representation:
Something like this:


Looks like nealy duplicate the EntityBean. My first impression was to used the entity as managedBean, but it seems to me (besides that it is may not very "pretty") that there are some problems which i whould have to deal with (instantiating the whole entity hierarchy, clear the values(?) when ManagedbBean is in Request Scope and reused)

Maybe someone with a little bit more experience with these two techonologies, could give an example which may be a pretty, clear und good way to combine EJB and JSF

thanks a lot
Dom
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While you can theoretically use an EJB as a backing bean, there's a whole raft of pitfalls, plus you're losing the benefits of having a distinctly layered architecture which is one reason we use a platform that's as slow and expensive to develop for as J2EE to begin with. Might as well just hack out ASP's if all you want is to "Git 'R Dun!".

If you're interested in more details, search this forum over the last few months. I think people have asked about it at least twice since January - either in regard to EJBs or JPA. Which have the same considerations.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!