[jboss-user] [JBoss Seam] - Re: Should you allow @Name on entity beans?

dan.j.allen do-not-reply at jboss.com
Sat Oct 20 17:09:34 EDT 2007


The @Name on entity classes is already handled as a special case. Method interception is disabled. Here is what the @Name gives you for entity classes:

1. give access to entity class via a context variable name for convenience of capturing form data related to the entity without needing to do a factory or other type of initialization

2. allow a default scope to be assigned so that, again, you don't have to do special factory stuff to get a fresh entity instance in conversation scope (which is the default)

3. ability to create a prototype of an entity class using component configuration (configure the properties in components.xml)

I don't think there is any harm in doing it. Whether or not you choose to make your entity classes Seam components by giving them a @Name annotation is up to you. If you don't use the @Name annotation, you can always do the same thing via XML in components.xml. There really is no harm in doing so.

Remember, entity class components are restricted components in that they have:

no bijection
no transactions
no event handling
etc. 

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

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



More information about the jboss-user mailing list