![]() |
|
URL of the article:
Highway 1 - From Dynpro To Web Dynpro
SAP's New Model-Driven Programming Model Revolutionizes the Development of User Interfaces
by Karin Schattka
Highway 1 in California - also know as the Pacific Coast Highway - winds in narrow hairpin curves through deep gorges. Anyone wanting to get to Los Angeles from San Francisco quickly, however, takes Highway 101, which cuts a straight line through the countryside. One could describe the road from ABAP/Dynpro to Web Dynpro in a similar way. The ABAP/Dynpro development model, created in the nineties, played a significant part in the development of ABAP-based SAP applications. In the meantime, powerful standards like Java/J2EE and Web Services were developed, which were driven and supported by SAP. Since Hasso Plattner's announcement that the SAP application server will support J2EE as well as ABAP, a new generation of SAP development tools has emerged. These tools support a new, powerful concept for building Web-based user interfaces: Web Dynpro for Java.
Overview of the Web Dynpro Concept and Definition Web Dynpro is SAP's programming model for developing user interfaces (UIs) for professional business applications. It is based on the flexible Model View Controller, which ensures that the UI (the presentation layer, that is) is separated from the business logic of the backend system. This architecture is already evident in the SAP NetWeaver Developer Studio - an integrated development environment. ![]() Fig. 1: SAP NetWeaver Developer Studio - Web Dynpro Perspective The Eclipse-based SAP NetWeaver Developer Studio offers intuitive, graphic tools for developing client applications and UIs. These tools visually support model-based development. This model-driven approach minimizes the number of lines of code that need to be written, and enables easy reuse of the UI components. Web Dynpro's objective is to ensure that most of the UI consists of references to existing components instead of being programmed from scratch, especially since manual programming is time-intensive and it also increases the likelihood of errors. Web Dynpro is nevertheless not a magic box that can guess what is on the developer's mind. And, for complex applications, it will certainly be necessary to make adjustments and changes to the generated source code. Developers can make these changes at any time during the development process. The broad graphic support, however, keeps the required effort to a minimum. One of SAP NetWeaver Developer Studio's main tasks is to support the model-based and code-based approach during the entire programming process, depending on the skills of the developer and the complexity of the application. The move from a declarative method to coding is not a one-way street; both directions are possible. A platform-independent meta-model is created when the UI is programmed. Java classes are generated from this model and then executed in the J2EE Engine of the application server at runtime.Web Dynpro also supports the development of applications for clients as well as for mobile devices. The developer can use the same development tools and the same UI elements (such as buttons, TextView, TextEdit, and input fields) as are used to develop standard applications that run on the desktop. The UI elements contain information pertaining to how they should behave on the different devices and browsers. Together with the device and browser recognition function of the application server, developers can program mobile applications that can run on different mobile devices.
Up to this point, Web Dynpro might not seem really new to an experienced developer; some other UI programming models also provide similar services. For instance, Java Server Pages (JSPs) also enable us to program dynamic Web applications. With the combination of JSP and tag libraries, we can even separate the presentation from the logic. However, the use of HTML tags, JSP tags, and Scriptlet code demand great discipline, otherwise, the advantages of separating the presentation from the logic quickly disappear. Like Web Dynpro, Sun's new UI Framework Java Server Faces comes with a complete set of tools for building interfaces. The Struts framework, which is easy to learn, also simplifies the development of Java-based applications. Web Dynpro, however, goes a few steps further in UI programming. Screen management and screen flow In the Developer Studio, the definition of nested views is supported graphically by the Navigation Modeler (see Fig. 2). With this tool, developers not only define the nesting of the individual windows, but also the navigation between the windows. The concept of data context and automatic data transport between them ![]() Fig. 2: Hierarchical Context Structure Within the Web Dynpro architecture, the contexts of the different controllers can be bound in different ways:
![]() Fig. 3: Mapping of Abstract Data Binding Web Dynpro generates the code for automatic data flow (along the connections) between the UI, the UI elements, the controller, and the model. Changes made to a context element are automatically passed on to all the elements that are bound to this context. Since all the data in the context elements is referenced, the entire data transport automatically works in both directions. Reusability of Web Dynpro components Dynamic programming Web Dynpro patterns Development of a Simple Web Dynpro Application Using the Graphical Tools of the SAP NetWeaver Developer StudioIn this section, we will detail a simple example of a Web Dynpro application - a credit limit check, which can be used by a company wanting to check the credit limit of a customer who placed an order, for example. The application uses a Web service that was published on the Internet -- it can be called from there as the data model.
Back to the example for Web Dynpro and Web Service - as mentioned earlier, Web Dynpro is a set of tools containing graphical development tools, wizards and templates that support the entire development process. They are shown and explained using the example for checking the credit limit: 1. Data Modeler ![]() Fig. 4: Selection of the Web Dynpro Model Using the set of icons visible at the left, the application developer can combine the appropriate elements (model, view, controller) and link them with Drag and Drop. In the view area you can see two views: the input view and the output view. As mentioned earlier, this application uses a Web service as the data model, and the Web Service used in this case is called Credit Limit Service (CLService). The CLServiceController controls the flow of data between the UI and the model. We can select the appropriate icon, for adding a new data model, from the available set of icons. After specifying the data model (CLService), a URL or a local file containing the WSDL must be entered. ![]() Fig. 5: Entry of the WSDL URL or File For the credit limit example, the Data Modeler has the following appearance: ![]() Fig. 6: Data Modeler for Checking the Credit Limit 2. Navigation Modeler The Navigation Modeler supports the design of the views and the navigation between the views: ![]() Fig. 7: Navigation Modeler for Checking the Credit Limit A set of views containing the input window (CLInputView) and output window (CLOutputView) as well as the corresponding outbound and inbound plugs for the navigation can be seen in the figure. Inbound plugs define the possible entry points of a view, and outbound plugs permit us to leave it with a different view. Plugs are always assigned to one view. 3. View Designer ![]() Fig. 8: Template Wizard Several templates are offered for selection. The template form can be used to define attributes for a PDF document that is part of the view. While the wizard for the table properties support the definition of the data binding for the tables created in the view, the ActionButton wizard allows to define the properties for a button. These templates enable us to create the views to check the credit limit without any manual programming. ![]() Fig. 9: CLInputView in the View Designer ![]() Fig. 10: CLOutputView in the View Designer Users of this application enter the partner number and credit segment in the input fields of the application and press the button: ![]() Fig. 11: Input View of End User As a result, the credit limit is displayed in the appropriate currency: ![]() Fig. 12: Output View of End User Please note that, up to this point, there has been no need to write any code - the application has been created using wizards and the flexible set of Web Dynpro tools.Design of a Complex Web Dynpro Application: Top-Down ApproachSpecial design models are provided for designing Web Dynpro applications for the various abstraction layers. These models can be used to design the application in greater detail. ![]() Fig. 13: Top-Down Approach to the Design
Following are the advantages of using Web Dynpro: Minimize coding - Maximize design!
Web Dynpro is SAP's strategy for developing Web applications, and is therefore the strategic approach for developing content for SAP's Enterprise Portal. Web Dynpro applications can be integrated in the portal quickly and easily. A Web Dynpro application that runs in the portal can use the portal services that are available, without writing a single line of code. The applications running in the portal are called iViews. iViews communicate with one another using portal eventing - that is, they can send and receive events from other iViews on the same portal page, whether they are based on Web Dynpro or not. Web Dynpro UI elements are based on Unified Rendering. Therefore, if a company needs to use their own logos and colors (called themes), simply pressing a button can change the appearance of the application. Web Dynpro applications can be adjusted using the style sheet editor of the portal. For example, the colors in the tables are adjusted and automatically used in all applications. Other integration features include the use of unified user management, session management, and WorkProtect mode. The integration of Web Dynpro applications in the portal will be intensified in future releases of the SAP NetWeaver application and integration platform. The following figure shows an Employee Self Services Web Dynpro application (within ERP 1.0), which was integrated in the SAP Enterprise Portal: ![]() Fig. 14: ESS in SAP Enterprise Portal Eat your own dog food SAP application developers use Java and Web Dynpro to develop new applications. The SAP Developer Network (SDN) is another excellent example for the use of homemade technologies. The application and integration platform of the SDN is SAP NetWeaver - based on the SAP Enterprise Portal, Knowledge Management, and J2EE Engine. Summary SAP has applied its experience from ABAP development to the Java development world. This process began with a carefully planned development project that was implemented by experienced developers. After some initial pilot phases, SAP is now ready to provide a programming model that significantly simplifies the development processes, both internally at SAP and at customer and partner sites. And that brings us back to Highway 101 -- passing the gorgeous scenery of the Pacific on a road linking two of the most beautiful cities of the world. Try it yourself - Download the Sneak Preview II with exercises and coding examples from the SAP Developer Network! Links and Literature
|
|||||||||
|