Different understandings are made every day. For these things, riding their way home floated into the brain ~~~
The previous article mentioned Dao, business, UI, and MVC. Once upon a time, we thought that the business logic was controller, and bean (the Entity Bean corresponding to the database table) was treated as a model, when I started to work together, there were few things and weak basic knowledge. When I wrote more, I began to see some misunderstandings. Of course, in practice, I would slowly change these incorrect ideas, because I see more and understand more.
When you get started, you don't know what data access is, what is business logic, What Is jump control, that is, a page is sent to the background, after processing, and then passed to the foreground page, of course, this is an access process. I personally think this may be MVC. Can this also explain that struts is a lightweight MVC framework?
Later, I had more contact and more processing, so I began to process it hierarchically. I used to extract the data access layer and extract the main logic processing, extract some data models so that the original background processing can be skipped and the parameters are encapsulated into data models. Have you found that we have refined the processing on the server side? In fact, we have been operating on the C content, and the data access layer here is Dao, logical processing is the business logic layer, and the original thing becomes the performance layer.
Some people will think, isn't there a model? What does it belong? It is DTO, a data transmission object that carries the interaction objects between the server and the client. At this time, do you think that the bean we used was a little biased. So what is the object bean corresponding to the database? It is the persistence object Po. How does it change.
When receiving a request, we need to get a data transmission object, which is composed of multiple business objects and other information. Therefore, we retrieve the objects at the business logic layer, obtain the business objects. The business objects are combined by multiple persistent objects. At this time, we use the Po objects for each database operation, they all correspond to the mutual conversion between the relationship and the object, so the Po is to complete such a task. In general, DTO analysis and processing is split into Bo and Bo analysis and splitting to obtain multiple Po. Then, we take the Po into the process of interacting with the database according to the business logic, in the same business logic, it is often stored in a transaction. According to the stack logic, after Dao completes processing, it returns to the business logic layer, forms a DTO, arrives at the performance layer, and returns it to the requesting user.
The above is a little thing that I think of today. I hope you can give me more advice ~