Back Forum Reply New

How often do people use persistence annotations for real projects?

I would post a poll about this if I was sure how to do that (and if I was sure I'm able to).

Concerning the use of Hibernate or JPA, you have a choice of using persistence annotations to define mappings, or other strategies including the XML mapping file, or even generation directly from database metadata (I don't know much about that option).

Considering annotations as one choice, and the quot;otherquot; strategies as the other choice, how often are annotations used for real mission-critical production applications, as opposed to the other strategies?

Personally, I feel that there are some purposes that annotations are good for, and some they are bad for. When the statement made by the annotation has very high cohesion with the class, method, or attribute, and does not associate itself with external concerns, that is a very good use of it. When the annotation references names or symbols which have to match names or symbols in external resources, I feel that this tends to degrade the long-term maintainability of the application.

I think persistence annotations are fine for functionality demonstrations, but I would never use them for real code.  I'd appreciate hearing your point of view.
¥
Back Forum Reply New