0% found this document useful (0 votes)
46 views4 pages

MVC Design Pattern in CRM Web Client UI

The document provides an overview of the Model View Controller (MVC) design pattern. MVC separates an application into three main components: the model, the view, and the controller. The model manages the behavior and data of the application. The view displays the user interface. The controller interprets inputs from the user and instructs the model and view to perform actions. For a CRM web client application, the model consists of contexts and context nodes that link user interface fields to business data. The view handles visual outputs and user interface elements. The controller processes user inputs and outputs, coordinates between the model and view, and controls navigation between views.

Uploaded by

khaleelinnovator
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views4 pages

MVC Design Pattern in CRM Web Client UI

The document provides an overview of the Model View Controller (MVC) design pattern. MVC separates an application into three main components: the model, the view, and the controller. The model manages the behavior and data of the application. The view displays the user interface. The controller interprets inputs from the user and instructs the model and view to perform actions. For a CRM web client application, the model consists of contexts and context nodes that link user interface fields to business data. The view handles visual outputs and user interface elements. The controller processes user inputs and outputs, coordinates between the model and view, and controls navigation between views.

Uploaded by

khaleelinnovator
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Model View Controller Design Pattern Overview

Business Server Pages (BSPs) can be created using different programming paradigms and design
patterns. But the CRM Web Client UI BSP is based on the Model View Controller (MVC)
paradigm. MVC is a widely accepted design pattern for developing object-oriented user
interfaces (UIs). It provides an effective way of relating UI layouts to an underlying data model.

An MVC application consists of the following:

1. Model
2. View
3. Controller





1. Model:
The model of the CRM Web Client UI BSPs consists of contexts and context nodes
that link the fields of a view to the underlying business layer (the BOL). This linking
is referred to as binding. Each data field on a view visualizes an attribute of a context
node. Each attribute of the context node is connected to a field in BOL Structure.

2. View:
The view handles the visual output. It is responsible for rendering the output and
Relevant UI controls, such as data fields and push buttons. The controller receives all
Output for rendering. All user input is passed from the view back to the controller for
Processing.

3. Controller
The controller handles the interaction logic and provides the connection between a
view and a model of an MVC application. A controller receives all keyboard and
mouse input from the view. Based on these events, the controller can decide how to
react (for example, by accessing data from the model or triggering the navigation to a
different view).






User Input (Request)

Get



Set


Data Output (Response)



[Link]
Class _Impl
Implementation of
model
Event Handling
Navigation

Model
Context _CTXT
Context Nodes
-CN00
-CN01
- CN02
-
[Link]
LayOut: BSP EXT Tags
Defining the View
Layout
Page Attributes
_CN00, _CN01, _CN02
The controller is the first element that is instantiated when the system navigates to
specific view. It triggers the context class and that itself instantiates the context nodes.
The context nodes are the link between the input fields on the view and the data model in
the BOL. For each Business object used in BOL, there is one context node necessary.
The context nodes follow the same hierarchy as defined in the data model.
Data are transported from Model to the view automatically through controller.
View does not contain any logic. It just uses BSP Extensions which generates HTML
Coding and uses ABAP as Scripting Language.
All user inputs are handled by controller. The data are transferred to Model and then
context nodes then Updates the BOL.
In case the user pressed a button (Event) the controller contains the logic what to do with
this click like navigate.
Whenever a user action is taken then view controller implementation class is triggered
first, because event handler method is defined here in the _IMP Class.
The views and their corresponding controllers and contexts of CRM Web Client UI
components can be accessed in the BSP WD Component Workbench (transaction
BSP_WD_CMPWB) by clicking Views in the Browser Component Structure.



In CRM WebClient UI components, each view has its own view controller. For example, the
view [Link] would have the corresponding controller [Link]

Common questions

Powered by AI

When a user input is received in the CRM Web Client UI BSPs following the MVC pattern, the process begins with the View passing the user input to the Controller. The Controller, which handles all input events, passes the input to the Model by updating the respective context nodes that are bound to the BOL fields . The Controller determines the appropriate logic to apply to the input, such as updating the Model or navigating to another View. This process is managed by the controller's implementation class triggered first due to its event handler method definition .

Context nodes in the MVC architecture of CRM Web Client UI BSPs serve as the link between the input fields on the view and the data model in the Business Object Layer (BOL). Each context node aligns with a business object used in the BOL, and they follow the hierarchical structure defined in the data model . They are essential because they ensure that data from the model is accurately bound to the view, facilitating the automatic transfer of data from the model to the view through the controller .

The initialization sequence in CRM Web Client UI BSPs when navigating to a specific view starts with the instantiation of the Controller . The controller immediately triggers the context class, which instantiates the necessary context nodes to establish the link between the model and the view fields . This sequence ensures that the business logic and data are prepared before the View is rendered, allowing for cohesive interaction handling and dynamic data presentation as dictated by the MVC pattern .

The limitations of the View component in the MVC pattern as applied in CRM Web Client UI BSPs include its lack of any embedded logic beyond rendering and responding to controller instructions. It is solely responsible for visual presentation using data provided and controlled by the controller, and it relies on BSP Extensions for generating HTML and ABAP scripting for view rendering . The View does not handle direct data manipulation or event processing, which confines its role to a static renderer dependent on external logic supplied by the controller .

The MVC design pattern facilitates better maintenance and scalability within CRM Web Client UI by separating concerns across three distinct components: Model, View, and Controller. This separation allows each component to be developed and modified independently without affecting others. The pattern promotes modularity, where changes in the UI (View) do not impact the business logic (Controller) or data handling (Model). This modularity enhances scalability as it allows for incremental updates and addition of new features without substantial reworking of existing structures .

Developers might face challenges in implementing the MVC pattern in CRM Web Client UI BSPs due to the complexity of ensuring seamless communication between the Model, View, and Controller components. The need for precise binding of context nodes to business object layers can complicate model management . Additionally, maintaining clear separation of concerns requires careful architectural planning, especially in managing the interaction logic on the Controller and its dependencies on other components. This can also involve tackling issues related to synchronous updates between the View and the Model through the Controller with minimal latency .

The BSP WD Component Workbench is significant for accessing CRM WebClient UI components as it provides a structured way to manage and view the components' MVC elements like views, controllers, and contexts. It aids developers in navigational and developmental tasks by listing all views with their corresponding controllers and contexts within the Browser Component Structure . This workbench supports streamlined access and maintenance of the MVC architecture, ensuring the efficient development and customization of CRM UI components .

The Model in the CRM Web Client UI BSPs consists of contexts and context nodes that bind the fields of a view to the underlying business layer (BOL). This linking, called binding, ensures that each data field on a view represents an attribute of a context node, which in turn connects to a field in the BOL structure . The View handles the visual output and renders it using data sourced from the Model via the Controller, which manages the interaction logic, receives user inputs, and processes them to update the Model or navigate to different views .

The Controller in the CRM Web Client UI BSPs acts as a mediator by handling interaction logic and serving as the connection point between the View and the Model. It processes all user inputs received from the View, deciding how to respond, such as accessing data from the Model or navigating to a different View . The Controller is responsible for instantiating context classes and their nodes, which link the View fields to the Model in the Business Object Layer (BOL).

Within CRM Web Client UI BSPs, the layout of a View is defined using BSP Extensions, which generate HTML coding and utilize ABAP as a scripting language . The View is responsible solely for rendering the output without containing any logic, making it dependent on the controller to drive its content and interactivity based on the model data linked via context nodes. The use of BSP Extensions helps ensure that the layout is dynamically rendered according to the underlying model and controller logic .

You might also like