Home > Back-end >  Framework of the development and solution of coupled doublethink annotation?
Framework of the development and solution of coupled doublethink annotation?

Time:09-25

First statement first I was a small white is still in the learning phase, in a recent study in some of the framework produces such doubts:
Framework can help us optimize code, simplify the development, and reduce the coupling degree, especially for the traditional javaEE project, writing SQL code the dao layer was once criticized said SQL + Java write coupled together dead, is not conducive to the maintenance of the late,
So I learned XML development of MyBatis framework and its configure SQL statements to the mapping file in practice although a little trouble, but also complete decoupling, but learning behind the MyBatis annotation development I don't understand, directly write SQL statements in the comments, it's not just back again, just a little a dao implementation class of this layer hey?
I don't know whether have bosses, thank you ~

CodePudding user response:

It depends on how do you think of your SQL, if you consider SQL and independent of the code of a thing, the SQL is requires a separate written in other places, if you think the SQL as part of the transaction, that followed the SQL code is ok,
General maintenance is based on the business, so he wrote SQL in the code will be a problem

CodePudding user response:

Decoupling is easy to understand these theories, the hard part is you know what is what do not calculate coupling, have all sorts of business in the application development, the relationship between things and things go, intricate, analyze the relationship between is difficult to place
  • Related