-
1. Re: Question: Seam and Reusability
swd847 Aug 11, 2009 6:31 AM (in response to coldgin)As far as I am aware JVM's are meant to ignore unkown annotations rather than throwing ClassNotFoundException.
-
2. Re: Question: Seam and Reusability
coldgin Aug 11, 2009 2:58 PM (in response to coldgin)Thanks for replying, Stuart. The problem that still seems to exist is reusability. I would like the reusability to be present across all applications (Seam and non-Seam). If I annotate an entity bean with Seam UI validation annotations for one application, then those annotations may not be applicable to a completely different Seam application context. This forces me to duplicate the entity bean so that it can be annotated differently for a second Seam application (consider that Hibernate entity pojos can be reused and their behavior can be altered in different contexts via application-specific hibernate mapping files).
This would lead me to believe that Seam UI validation annotations (or the functionality that they provide) belong outside of the entity bean code. The annotations in the scenario I am describing prevent the entity bean from being reusable across multiple Seam applications. It may be said that the entity bean could possibly be extended and overriden, but the inheritance approach seems a little messy IMO.
-
3. Re: Question: Seam and Reusability
niox.nikospara.yahoo.com Aug 11, 2009 4:20 PM (in response to coldgin)Hi Brendan,
I believe that if the validation is intrinsic to the entity, it can be modelled as a Seam/Hibernate validation annotation. If it is not, then indeed it belongs to another layer, eg rules.
For example consider an entity representing a person. The
age
field should be grater than zero, and this is an intrinsic rule: it doesnt make sense for age to be less than 0. However, in a loan application, the age might have the additional constraint that it is above 18 and below 65. I believe the latter constraint belongs to the rules of the specific application, not the entity.