JPA/Hibernate and MyBatis debates sparked by interviews

This is the most popular framework for connecting databases in the java industry. If they are denied together, it will inevitably lead to a war of words.

For complex business logic, it is easier for JPA/Hibernate to fall into awkwardness and less elegance when dealing with it. This sentence applies to MyBatis as well.

For complex applications, MyBatis provides the function of splicing sql statements in the configuration file, so the focus is on this.

Splicing sql belongs to the category of business logic. MyBatis implements business logic in XML configuration files, and implements algorithms in XML text that should only save data, which is not what things should look like anyway.

I have been thinking about this question all the time, and it has been repeatedly touched by the interviewer and the interviewer during the interview process these days. But they are not in-depth, maybe the interviewer is not interested in this, maybe the interviewer has not thought about this issue too much.

This is the reason why I have never used ORM or MyBatis, I have used my own middleware.

I think that for the slightly complex project that I will take over (have already received the offer), the business logic of obtaining SQL statements should be encapsulated into a set of interfaces, and the specific implementation of the interface should be packaged and plugged flexibly . To achieve decoupling and to achieve cross-database incidentally.

Just a whimper by the way
. Please don't interview candidates for positions involving architecture with programmers who aren't very involved in software architecture. This is disrespectful to job applicants.
Please do not use the very basic basic knowledge written test paper to examine the software architecture level of candidates, especially when it comes to specific frameworks, because for a specific application scenario, there may be countless exquisite alternative architecture solutions in the world, and we may never Never heard of it, and every programmer has his own understanding of software architecture, elegant or clumsy. It is very likely that the framework examined by the written test may have been discarded and not used by the candidate for many years.
For the above situation, I hope that if I encounter it in an interview in the future, I will turn around and leave.


Specific architectural ideas
My java web architecture scheme http://afadgaeg.iteye.com/admin/blogs/2395132
is in the second half of the article The

latest
related reading: Design of user grouping rights management module http://afadgaeg.iteye.com/blog/ 2395507

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326224023&siteId=291194637