I participated in an e-commerce project at the front-end time and admired the system architecture. Here we will share with you the web layer, business layer, and persistence layer.
The web layer uses velocity + turbine. velocity, which is equivalent to JSP. Compared with JSP, it is better to separate the display function (in fact, because the velocity language does not have JSP powerful functions ). Velocity does not have complex logic and is mainly responsible for displaying objects in vo. Corresponds to struts's solution to JSP's shortcomings. Our system uses turbine as the control layer to connect the display layer and business layer. The control layer is responsible for simple verification and calls delegate. Call Session Bean in delegate.
The business layer is mainly encapsulated in AO (Application object. The Session Bean only calls ao to execute the business logic. Return context from Ao until control layer. The reason why AO is not directly called from the control layer is for future expansion, layering, and deployment.
The database persistence layer uses ibatis. Someone is responsible for Dao in the development process. We only need to tell him the required interface. Ibatis is an open-source framework. What is different from Hibernate is that it does not map Javabean to database tables, but an to SQL statements. In addition, all database operations can be configured in XML files instead of hardcoded to Java.Program.
Another feature of this framework is that the database returns do (database object) and the page uses VO (value object ). Multiple do objects can be merged into one VO object, corresponding to one page.
The framework uses a lot of services and uses XML files to configure services.