Skip to Content

New Web Dynpro Java Tutorial – Component Interface Definitions in Practice

Within this WebLog I want to promote the newest Web Dynpro tutorial on Component Interface Definitions in practice. Go through this valuable learning material in case …

You are a Web Dynpro Java application architect who wants to know …

  • the technical concepts and practical use-cases of Web Dynpro Component Interface Definitions,
  • how the architecture of component-based Web Dynpro applications can be improved applying the separation of concerns principle,
  • how to realize a flexible Web Dynpro application architecture which decouples a Web Dynpro component (interface definition) used at  designtime  from its implementation created at runtime,
  • how to separate the development entities of a large-scale Web Dynpro application within multiple Web Dynpro Development Components in the NWDI.

You are a Web Dynpro Java developer who wants to know …

  • how to define and how to use Component Interface Defintions,
  • how to implement a Locator component and how to invoke the IWDConfiguration API to retrieve component configuration data at runtime,
  • how to implement the component instance creation for a used Component Interface Definition,
  • how to visually embed a UI component interface view in the Root component window,
  • how to feed UI components with external context data stored in a Java Bean Model component using external context mapping,
  • how to declare Public Parts and usage dependencies of Web Dynpro DCs.

Decoupling Web Dynpro Components with Component Interface Definitions


This set of Web Dynpro Development Components (Local Web Dynpro DCs) demonstrates how to design a state-of-the-art Web Dynpro application architecture using multiple components and component interface definitions in a simplified but realistic application scenario:

“In a sales opportunities application we want to allow the replacement of the standard viewer UI with a custom viewer UI without code modification or re-deployment”.

In a successive approach we present six different versions of a component-based Web Dynpro application fulfilling the above development task. Starting with a “bad” solution in VERSION_01 we step-by-step demonstrate improved solutions utilizing certain Web Dynpro features. The final solution VERSION_06 combines the following techniques in a “state-of-the-art” multi-component application architecture:

  • Component Interface Definitions (see figure above, point 2) to loosely couple a root component with its embedded UI component implementations based on an “abstract” defintion of the UI component interfaces (component interface controller and component interface views),
  • Context-Based Dependency Injection Pattern to transfer configuration data (fully qualified component and DC names of the configured UI component implementation) from a faceless Locator Component (see figure above, point 1) to the root component,
  • Web Dynpro IWDConfiguration Service to retrieve configuration data from the database of the SAP NetWeaver AS for Java in the Locator Component at runtime,
  • External Context Mapping to feed UI components with external context data stored in a model component,
  • ViewContainerUIElement to visually embed a UI component interface view in the root component window.

Web Dynpro Development Component Separation


The Web Dynpro sample application is separated into multiple Web Dynpro DCs. You will learn how to correctly define the required Public Parts of the DCs comprising the Locator Component, the Component Interface Defintion the Java Bean Model and the Model Component. There are no designtime dependencies between the Root Component DC and the two UI Component DCs .

Configuring the used Component Implementation

This sample application also demonstrates how to configure the used UI component implementation at runtime without any code-modification. After applying a custom configuration for the fully qualified names of the implementing Web Dynpro component within the SAP NetWeaver Administrator (see figure above, point 1) you just have to refresh the Web Dynpro browser client so that another UI component is displayed.

Learning Material and Web Dynpro Sample Application DCs

Download all related learning material on Component Interface Definitions in practice from the Sample Description Page 42:

  • Documentation: A Powerpoint presentation handout PDF with more than 50 slides with more on Web Dynpro Component Interface Definitions in Practice
  • Exercises: Two exercises describe how to define a Public Part and a component usage relation, how to define an external context mapping relation, how to define a component usage relation to a Web Dynpro component interface definition, how to retrieve configuration data with the (I)WDConfiguration service API, how to apply context-based dependency injection between a locator component and a root component, how to create a component instance for a used component interface definition at runtime and finally how to configure the used component implementation in the Visual Administrator so that no code-modification is required.
  • Local Web Dynpro DCs: a ZIP file contains the ready-to-use Web Dynpro Development Components and the initial exercise components.
  • Readme: a Readme document describes how to import the local Web Dynpro DCs (contained in the above ZIP file) into the SAP NetWeaver Developer Studio.

All provided local Web Dynpro DCs are based on the Sneak Preview SAP NetWeaver ’04s (SP9, Java Edition). Nevertheless your can also apply Web Dynpro Component Interface Definitions within SAP NetWeaver 04.

Enjoy Web Dynpro,

Bertram Ganz, NW ESI F UI – Web Dynpro Foundation for Java, SAP AG

You must be Logged on to comment or reply to a post.