| Author |
JSF 2 with JDO 2.3 (is it a bad practice to make a class PersistenceCapable,ManagedBean )
|
Daniel Reznick
Ranch Hand
Joined: Oct 23, 2008
Posts: 48
|
|
Heya!
I building an web app using JSF2 and JDO and i have a User class which supposed to hold all user information (session scoped) , the thing is that i will have the same data saved in db, so the question is, wont it be better to make ONE class to serve as managed bean session scoped and PersistenceCapable ?
Or create to seperate classes and hold the same data in them both? (this sounds like to much maintenance)
e.g.
@PersistenceCapable(identityType = IdentityType.APPLICATION)
@ManagedBean(name="xyz")
@SessionScoped
I have seen some posts about jsf and jpa... but not jdo....
Any suggestions?
Thanks ahead
Daniel
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
|
Aside from the maintenance issues that arise when you don't keep clearly-defined tiers in your application, there's a fundamental problem with any sort of object which can be replaced in its entirety, JPA, EJB, or DIY. That's because the managed bean facility isn't designed to delete and replace objects - at least in JSF1. The closest you can get is Request-scope objects, but Request scope tends to have issues in JSF because it's too short a scope to support postback operations well. They actually added a new scope in JSF 2 for just that reason.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: JSF 2 with JDO 2.3 (is it a bad practice to make a class PersistenceCapable,ManagedBean )
|
|
|