Mysticbinary

WEB MVC each layer introduce

What is WEB MVC?

Whay need WEB MVC?
As WEB application is a very huge program. The correct approach is to layer and module a large program.
The WEB MVC is the effect way.

How to layer?

  • Model – Represents the business layer of the application
  • View – Defines the presentation of the application
  • Controller – Manages the flow of the application

To layer Advantage:

  • 多个开发人员可以同时使用这三个层(模型、视图和控制器)
  • 提供改进的可扩展性,补充应用程序的增长能力
  • 由于组件之间的依赖性低,因此易于维护
  • 一个模型可以被多个视图重用,这提供了代码的可重用性
  • 采用 MVC 使应用程序更具表现力和易于理解
  • 应用程序的扩展和测试变得容易
  • ...

若依框架自动生成的代码和MVC的对应关系

        V      
  • HTML
  • JS
        C      
  • controller
        M      
  • Service-impl
  • Service-interface
  • domain
  • mapper
  • DB(mysql-库-表)

下面是我用若依自动生成代码功能生成的代码(感觉很好用,基本能满足我90%的后台开发需求了),我梳理了一下各个模块代码和MVC的对应关系。

reference

posted on 2023-02-21 10:41  Mysticbinary  阅读(385)  评论(0编辑  收藏  举报

导航