Professional Documents
Culture Documents
Andreas Fahle
Seminar System Modeling 2005
Hasso-Plattner-Institute for Software Systems Engineering
andreas.fahle@hpi.uni-potsdam.de
Abstract
SAP Web Dynpro is a framework for developing user
interfaces for use with the SAP NetWeaver platform. It
comes with design tools that are part of the NetWeaver
developer studio, enabling developers to do most of the
programming in a graphical or declarative manner.
Web Dynpro applications can run on different
platforms, including Java, ABAP, and .NET.
Component-orientation supports reusability of user
interfaces.
The concepts covered in this article allow a
separation of layout and logics, and ease the
integration of different backends. Using contexts and
models, data may be synchronized automatically
between the user interface and the backend.
Besides discussion of basic concepts and a glance at
the development process, this article briefly illustrates
the client-driven execution of a Web Dynpro
application.
Keywords: Web
Interfaces
Dynpro,
NetWeaver,
User
1. Introduction
1.1. What is Web Dynpro?
Web Dynpro is a framework for development of
user interfaces (UIs) for use with SAP NetWeaver.
It supports programming for different platforms,
including Java, ABAP, and .NET. For Java
programming, Web Dynpro comes with extensive
design tools, which are based upon the Eclipse
framework and part of SAPs NetWeaver
Developer Studio.
The product name has a historical background:
SAPs legacy product lines, starting from the R/2
system, include a technology for interactive UIs
called Dynpro, an abbreviation for dynamic
program. Dynpro UIs are described in the ABAP
programming language and rendered in a
view
EmployeeForm
control
to the
backend
component
EmployeeBaseDataEditor
"model manager"
view controller
of EmployeeForm
component
controller
control
"name" text field
context
context
model class
Employee
control property
text
context element
employee/name
context element
employee/name
model property
"name" attribute
control property
context element
context element
model property
model
Human Ressources
2. Basic concepts
2.1. An example
The basic concepts of Web Dynpro are now
explained using the example in Figure 1. A form
for editing employee base data (like name, date of
birth and so on) should be realized as a Web
Dynpro application. Note that is a simple
example: it comes with only one view and no
further controllers beyond the view controller and
the component controller. Furthermore, it uses no
complex data types, i.e. only strings are mapped
between contexts.
2.1.1. View
A view describes a visible screen area, which
contains and lays out controls (also called UI
elements or widgets). In the example, a view
called EmployeeForm contains controls of type
text field for displaying and entering information
such as the name of an employee. Actions are
defined for designated user input (i.e. entering
text, or pressing a button), they may trigger event
handling.
Views can be arranged to complex screen
layouts using view areas, view sets and windows,
and navigation plugs may be added to a view for
switching between views. Both is beyond the
scope of this article.
2.1.2. Controller
For realization of dynamics, controllers are
required. Every view has a dedicated view
controller, and every component has a component
controller. Custom controllers may be added for
further structuring of the system.
A view controller performs event handling
based of the actions invoked in the view. For
example, the view controller of EmployeeForm
may react on pressing a button by updating data
(see section 2.1.6) or switching to another view.
Besides event handling (which is described in
event handler methods), controllers may perform
other activity described in methods.
2.1.3. Model
A model describes data in the backend, for
example using JavaBeans. Those data are
2.1.4. Component
A reusable, encapsulated part of the system (and
the describing software package) is called a
component. In most cases, a component contains
several views and controllers (in fact, a
component controller is always present), and uses
one or more models. In the example, the
component is called EmployeeBaseDataEditor.
Components are able to communicate with other
components via component interfaces.
2.1.5. Application
An application, which is not embodied in Figure 1,
serves as the entry point for users in terms of
something runnable from the frontend. It is
identified by a uniform resource locator (URL).
Running an application means
1. starting a designated component, and
2. navigating to an initial view, which in turn is
displayed in an initial window.
2.1.6. Context
All data processing in a Web Dynpro application
is done via contexts. Each controller has a context,
which represents a hierarchical data model1 as
depicted in Figure 2, where leaf nodes are typed
using Java native types (e.g. String as in the
example) or Java dictionary types.
Typically, a view controllers context keeps the
Model means a structure of metadata (i.e. types and their
relationships) here. The quotation marks are used to
distinguish this term from a WebDynpro model as
introduced in section 2.1.3.
1
Figure 2 A context
2.2. Meta-model
In Figure 3, all the concepts introduced so far are
put together to form a meta-model. The entity
types and relationships concerning screen layout
and navigation are grayed out since they are not
covered in this article.
As Figure 3 depicts, a component consists of
views and controllers, may use models, and is
started by an application. Controllers are
partitioned into view controllers, component
controllers, and custom controllers, whereas there
is exactly one component controller, and one view
controller per view. A view consists of controls,
which have control properties. As well, a model
consists of model classes, which have model
properties.
A context is part of each controller and
consists of context elements. To simplify matters,
context elements are not partitioned into non-leaf
and leaf elements in Figure 3, so it is true that
context elements may be bound to both model
classes and model properties. On the other hand,
context elements may be bound to control
properties, and can be mapped to context
elements in other contexts.
screen layout
application
start
component
have
use
window
consist of
component
controller
custom
controller
consist of
view
controller
controller
model
view
outbound
plug
have
navigation
link
context
inbound
plug
plug
model
class
control
have
have
model
property
context
element
control
property
bind
bind
navigation
map
Figure 3 Meta-model
3. Development process
As mentioned before, the NetWeaver Developer
Studio provides tools to create Web Dynpro
applications in a graphical or declarative manner.
Usually, this includes all the layout and
navigation, as well as context data and model
binding. These pieces of system description are
known as Web Dynpro metadata, for which the
corresponding
Java
code
is
generated
Web Dynpro Tools
Editor
developer
Generator
Web Dynpro
Metadata
Java Code
Step
Start
create component
(code is generated)
Design views
create view (code is generated)
place controls on view
(metadata are generated)
add control properties
(metadata are updated)
Design screen layout
apply screen layout to views
(metadata are generated)
Design navigation
create and connect navigation plugs
(code is generated)
write event handlers
Design data flow
populate and map contexts
(metadata are generated)
use models
(metadata are generated)
Add additional features
add controllers, write event
handlers and methods
Web Dynpro
client
4. Execution
decl.
decl.
graph.
decl.
graph.
graph./
decl.
proc.
graph./
decl.
graph./
decl.
proc.
Web-Dynprobased application
screen data
Type
Web Dynpro
runtime
RMI
Backend
application
J2EE
Application Server
business
data
Backend server
(J2EE-based)
User
R
R
Web browser
Web server
HTTP
Client
SAP Java
Connector
R
Backend server
(ABAP-based)
Presentation server
SOAP
5. Conclusion
With Web Dynpro, SAP introduces a powerful
framework for user interfaces in NetWeaver.
Although the combination of Java-based server
applications
and
JavaScript-enabled
web
browsers is the most common use case at the
moment, it is open for different programming
languages and platforms, different frontend
types, as well as new backend types.
Most of the programming can be done in a
graphical or declarative manner. The NetWeaver
Developer Studio, which offers the tools to do so,
is in turn based upon the Eclipse framework and
thus excellently extensible. At product level, the
component concept supports reusability of Web
Dynpro applications.
From a technical point of view, the mapping
and synchronization of data between UI controls
and the backend via models and contexts is a
distinguishing feature. All activity is initiated
from the client, forming roundtrips. This
approach makes Web Dynpro feasible for a large
class of frontend types (particularly, limited web
browsers).
It's a simplified association that the Web Dynpro client
communicates with a web browserin fact it is implemented
by parts of a web browser. However, one can consider these
components two agents (one for screen interaction, one for
page loading) to preserve the idea of layering.
2
References
[1] Kessler, K., Tillert, P., Dobrikov, P.: JavaProgrammierung mit dem SAP Web Application
Server. Galileo Press, Bonn 2005.
[2] McNulty, P.: Web Dynpro Overview. SAP AG,
2002.
[3] Tillert, P., Wilson, A.: Web Dynpro
Introduction/Concepts. SAP AG, 2003.
[4] SAP Library Development Manual, Web Dynpro.
[5] SAP Library Architecture Manual, Web Dynpro
Architecture.
[6] SAP Online Help, Creating Your First Web Dynpro
Application.
[7] Knpfel, A.: Konzepte der Beschreibung
interaktiver Systeme. Universittsverlag Potsdam,
Potsdam 2005.
[8] Fundamental Modeling Concepts home page,
http://www.f-m-c.org