Expert guide: how to learn about hibernate
It's easy to get started with hibernate, and I don't dare to boast of my skills. When I read the hibernate documentation for the first time, I also felt very difficult, but not because hibernate was difficult to grasp, because the hibernate documentation is a permanent layer design experience and best practices everywhere. The Hibernate documentation is accurate. Most of the content is about the persistence layer design of objects, rather than simply using hibernate. It is enough to check Java Doc with problems. So learning about Hibernate is mainly to learn the design pattern of the persistence layer. If you have read all the hibernate documents, you will only mention the hibernate configuration and hibernate class call problems all day long, I don't think such a person is actually getting started.
I am not very familiar with the hibernate configurations. Every time I write HBM, I need to check a little bit against the document. The class call parameters do not remember, and the Java Doc is required for writing code. However, when I was learning about hibernate, I concentrated all my energy on understanding the operating principles of hibernate, and concentrated my energy on the principles and skills that should be grasped by the persistence layer design. These are the most reusable things for me. It is no exaggeration to say that after learning about hibernate, I have also improved the programming of JDBC. Let alone the Framework Design of The Persistence Layer of the J2EE architecture, which is basically easy to understand, even if you change the API in the future and do not use hibernate, you can use JDO, Castor or something. These experiences will be the same.
Learning about Hibernate is not mainly about how to configure hibernat, but how to generate HBM files using tools. If you focus on this, it is basically equivalent to learning about hibernate. The essence of hibernate lies in the unparalleled Smart Object Persistence Layer Design. These persistence layer design experiences won't be lost because you don't need hibernate. I learned hibernate myself, I have obviously felt that the design capability of the persistence layer has gained a lot of experience. These experiences can be used not only in Java, but also in. net. So I just want to learn how to configure hibernate. When I use it, I will know where to query it. I will not see a bunch of complicated generation tools at all, in this case, you can use hibernate to replace JDBC to write programs, but it takes three days. I think three days is not a luxury for you.
Why do I emphasize learning the design concept of the Object Persistence Layer of hibernate? So what's your ideal is to be a programmer all your life? Or want to develop in a higher direction? From the perspective of pure technology, the highest point of career development is "System Architect". Isn't Bill Gates also called Microsoft's chief System Architect? The position of system impact ect requires your learning and comprehension skills. If you cannot apply the design experience gained from learning hibernate to other places, you will fail, it is not qualified for system impact ect.
Regardless of JDO, hibernate, toplink, cocobase, Castor, or torque, OJB, software usage and configuration methods can be different, but they are essentially Orm, it is encapsulation of the persistent layer of JDBC objects, so it takes only one month to learn and master hibernate, so you should not learn about OJB for more than one week, because you have made the design of the Object Persistence Layer easy. All you need is to familiarize yourself with the ojb api and configuration, you have long been familiar with how to use OJB for persistent layer development.
So when you have mastered more than two types of ORM, you should be able to design a persistent layer suitable for your project regardless of the restrictions of the ORM software used, this is the level of system impact ect. Let's use Jin Yong's novels as an example. Zhang Wuji learns the sword, only remembers the meaning of the sword, but does not remember the strokes. This is the real master, and the low-handed will only learn the sword, instead of understanding the meaning behind the sword moves, you will never be able to learn the sword for the rest of your life. Therefore, Zhou Dian saw Zhang Sanfeng's second demonstration of Xiao Jian. His tactics were completely different and he thought it was another set of things. In fact, they were essentially the same. To learn about hibernate, do not learn a variety of tools one by one, and master its object persistence layer design philosophy.