[jboss-user] [JBoss Seam] - Re: HowTo: When going to a page to enter data, pull from db

CptnKirk do-not-reply at jboss.com
Sun Apr 22 20:00:41 EDT 2007


christian.bauer at jboss.com wrote : I prefer exactly the opposite, with a Search conversation scoped component that holds my prototype entity during the search conversation. Gives me a lot of control over what the user can select on the search screen and how I handle this in the backend:

I really like your search controller.  I especially wish Seam's generic DAO (or maybe Query) construct came with *ByExample() methods.

The problem I usually face, and maybe search is a bad example, is the necessary reuse of the entities in other controllers.  Lets take profile or preferences.  Maybe our users are able to set the default number of entries per page in some profile entity.  We could have a ProfileController.profileEntity type system (ok, an EntityHome would probably work well here, whatever just an example).  But then what if you want to access some profileEntity properties in your UserSearchController.  In the past there was value binding expression ugliness and you had to couple your ProfileController to your UserSearchController because it was the accessor.  Seam allows me to avoid all of that baggage.

Unfortunately, I seem to get bitten by this regularly.  It seems like no sooner do I define a UserSearch like yours, than a PM wants to reuse the entity used in this search in some other area of the application (without re-entering the data of course).  This is why I generally prefer to separate my entity creation logic from my entity manipulation and business logic.  I still love the UserSearch example, I'd just pass in the exampleUser along with the other values.

On the flip side, I'd love to learn something new.  If I could be achieving my goals in a better way, please set me straight.

What my original post was trying to get at was that regardless of whether exampleUser is passed in or is part of the UserSearch component, the exampleUser is not retrieved via a call to UserHome.instance.  Where UserHome is created for the sole purpose of providing the exampleUser.  This is what I think the original thread creator was doing, and I think we can both advise against using EntityHome in such a way.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039658#4039658

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039658



More information about the jboss-user mailing list