官术网_书友最值得收藏!

Application structure

The A1 electronics e-commerce project uses a Model-View-Controller (MVCarchitectural pattern. As the details of Spring and the MVC architecture are not in the scope of this book, only the relevant parts are explained here. This MVC architecture reflects in the structure of the code as shown in the following diagram:

  • Model: The following packages are the Model part of MVC architecture:
    • com.a1electronics.ecommerce.dbo: All the entities from the database are mapped to Java objects along with their relationship
    • com.a1electronics.ecommerce.dao: A layer to access the objects in the dbo layer and has generic functions to add/remove/delete/update objects
  • View: The views folder in the preceding figure is the View part of MVC architecture. These are JavaScript/HTML pages which are returned in response to users requests via the Controller. This is what gets rendered in the users' browser.
  • Controller: The package, com.a1electroncs.ecommerce.controllers, is the Controller part of MVC architecture. This is where all the users' requests are accepted and, depending on the application logic, redirected to the correct service in the com.a1electroncs.ecommerce.controllers services layer package.

This MVC architecture is shown in the following figure:


主站蜘蛛池模板: 祁连县| 方城县| 中山市| 高陵县| 浪卡子县| 桐梓县| 慈溪市| 礼泉县| 瓦房店市| 庆城县| 黄浦区| 秀山| 新绛县| 海阳市| 科尔| 江阴市| 诏安县| 吴旗县| 墨江| 乌兰浩特市| 疏附县| 古交市| 宝山区| 松阳县| 乡宁县| 武平县| 明光市| 舟曲县| 尉犁县| 钦州市| 云浮市| 丰城市| 廊坊市| 乐东| 英德市| 陆川县| 洪洞县| 聂荣县| 万宁市| 海伦市| 隆子县|