Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the SSM environment in Mvc mode

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "what is the SSM environment in Mvc mode". In the daily operation, I believe that many people have doubts about what the SSM environment is in Mvc mode. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "what is the SSM environment in Mvc mode?" Next, please follow the editor to study!

I. layering strategy

MVC pattern and code layering strategy, the full name of MVC is ModelViewController, namely Model-View-Controller. As a model of software design, it organizes the code with a method of separating business logic, data and interface display, and aggregates business logic into one component. While improving and personalized customization interface and user interaction, there is no need to rewrite business logic. This is a development model. However, it is not the layering pattern of the code in actual development. Usually, the back-end code of the SSM framework is layered as follows:

Controller control layer: define server interface, input and output parameters, and some input parameter verification

Service business service layer: assemble business logic, business verification, and build parameter models needed in the control layer.

Dao data interaction layer: provides data query methods needed by the service layer, and deals with logic related to data interaction conditions.

Mapper persistence layer: a commonly used persistence layer component based on the native support required by the mybatis framework

2. Control layer

1. Rest interface style

Different styles of annotations are used based on the logic of resource access and processing. For example, resources are added, updated, queried and deleted.

/ * add * / @ PostMapping ("/ insert") public Integer insert (@ RequestBody BaseInfo baseInfo) {return baseInfoService.insert (baseInfo);} / * Update * / @ PutMapping ("/ update/ {id}") public String update (@ PathVariable (value = "id") Integer id, @ RequestBody BaseInfo baseInfo) {if (id)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report