java - Why are people continuing to use xml mapping files instead of annotations? -
I have seen strange facts (based on the questions given in the hibernate tag) that people are still actively using XML files
In some cases, where it is necessary:
- You are using the sections provided to you to specify their hibernate / jpa mapping for annotation. , And you want to map them.
- You are writing an API, whose domain classes can be used without a JPA provider, so you do not want to force a JPA / Hibernate dependency.
But this is not in general matters, I think.
My assumptions are:
- People are used for XML files and do not feel comfortable in them / don
- Java pre 1.5 projects Is forced and nothing is about it
- People do not know that annotation is a full-featured replacement of XML mapping.
- Heritage systems are supported and therefore attitude is changing c
- People are afraid that mix annotations with their classes are incorrect.
Any other possible explanation?
The domain layer and persistence layer are considered from a few different concerns, using two layers of pure XML approach Probably kept as loose couplings; Annotation joints using two layers more tightly, as you are strongly embedded in the code domain code.
Comments
Post a Comment