Home > Back-end >  SSM project in Java configured XML configuration is better
SSM project in Java configured XML configuration is better

Time:11-18

The teacher said that the Java configuration way better than XML why great god give advice or comments, please

CodePudding user response:

Is to use Java classes, use full annotations way?

CodePudding user response:

Your teacher said Java configuration probably is the way of annotations, wrote SQL string readability, the advantage is what you see is what you get, but now have enough plug-in interface can be directly from a link to the exact location of the XML, XML has the advantage of better readability.

Actually the best way is to don't have to write a single table SQL operation, both the Java and XML, you can choose to mybatis - plus, or mybatis generator to generate, were written to avoid single table SQL

CodePudding user response:

The teacher said is wrong, you is the way is a kind of annotation, a way is XML, no difference in two ways, you the key to understand the bean of the spring container loading mechanism, the end result is converted to Java beans

CodePudding user response:

All annotations coupling is too high, although XML annotations slightly a little trouble, but high coupling without annotation, you can be mixed according to their own requirements

CodePudding user response:

First of all thank you for your comment I said this configuration is the configuration file is not mybatis mapper is in a configuration class new those beans in the spring configuration and the way I want to know this in the configuration class good or XML

CodePudding user response:

XML way lies in the maintainability is much higher than the Java configuration, especially in the actual production, by modifying the XML way to change configuration, far more than you to modify the source code and then packaged release less difficulty, particularly special in a small company without a perfect version of the code maintenance, you never know what you typed the number of bugs in the new package to the end (often tears of packaging error)

CodePudding user response:

Java configuration facilitate programmer debugging and find problems, and XML is neat and specifications, convenient maintenance, but most now application is agile, so easy to bias the Java configuration, after all in a bunch of XML to find corresponding relation is egg pain,
  • Related