ABAP Objects Design Patterns – Model View Controller (MVC) Part 1
来源:互联网 发布:医生收入 知乎 编辑:程序博客网 时间:2024/06/05 16:42
转载自 By | October 13, 2008 | ABAP Objects, OO Design Patterns
Today we will discuss about the Design Pattern: Model-View-Controller, which is also very famous by its abbriviation MVC. By definition, MVC is to isolate the business logic from the User Interface which gives great degree of flexibility to change business logic independently to the user interface and vice versa.
Basics of MVC
In MVC, User Interface acts as the View; Business logic acts as the Model and the link which provides the link between the View and Model is known as the Controller. In real time business, MVC is used anywhere, where users have a choice to select his or her view. For example, Windows Media Player, Gmail or Yahoo mail and so on. All these type of application provides us the option to select the skin as per our choice.
Let’s take an example: We have to develop one Sales report for our corporate intranet. This report must have the option to display the sales data in the classical report format; different charts – pie, bar, line or both – report & chart and it must be based on the User’s choice. This type of requirements where we can easily separate the Business logic and the views are the best candidates for MVC.
Generally, Model sends the data to controller and controller will pass that data to Views and views will display the data as per their nature. In SAP, our business logic(model) will not send data unless and until View request for an data because ABAP is event driven language. Like user has to run some transaction to get the data, means application view has to initiate the process and ask for the data from the Model. In this requesting process, Controller will help the view to be apart from the model.
UML for MVC
UML diagram of the typical MVC application would be:
As we can see here, Model will send the data to the Controller and controller will pass that information to the View. Now, its a view’s responsibility to create a user specific view – Report, or Chart.
Advantages of using MVC:
Since both our business logic and view logic are different, we can easily change any of the logic without interrupting the other part.
In the next post, we will see how we can implement the MVC design pattern in ABAP usin the ABAP Objects.
- ABAP Objects Design Patterns – Model View Controller (MVC) Part 2
- ABAP Objects Design Patterns – Model View Controller (MVC) Part 3
- ABAP Objects Design Patterns – Model View Controller (MVC) Part 1
- ABAP Objects Design Patterns – Model View Controller (MVC) Part 2
- ABAP Objects Design Patterns – Model View Controller (MVC) Part 3
- Model-View-Controller (MVC)
- Model View Controller(MVC)
- Model-View-Controller(mvc)
- mvc(model view controller)
- MVC(Model-View-Controller)
- MVC模式 "Model-View-Controller"
- MVC(Model-View-Controller)
- Yii - Model-View-Controller (MVC)
- MVC(model-view-controller)
- MVC模型(Model+View+Controller)
- Model-View-Controller MVC模式
- MVC(Model View Controller)是什么?
- MVC学习1-实现Model—Controller—View分离
- Model-View-Controller 编程模式(MVC)
- Model View Controller(MVC) in PHP
- centos 核心与核心模块——查看核心模块信息
- 文本不换行,超出显示省略号
- 【23种设计模式】创建型模式 > 原型模式
- web项目
- 26muduo_net库源码分析(二)
- ABAP Objects Design Patterns – Model View Controller (MVC) Part 1
- prim算法
- 去除二值图像的杂散点
- 利用cron监视后台进程状态(二)
- 算法题目——python基础巩固练习一 斐波那契数列
- Scala保留字
- 容器适配器
- Android之Kotlin实现补间动画-(TweenAnimaion)
- 今日头条2017内推