Show TOC

Creating a Web Dynpro ModelLocate this document in the navigation structure

Prerequisites

You have created an empty UI development component and defined the dependencies.

More information:

Creating Development Components

Defining Dependencies Between Components

In the Composite Development Scenario, you require a Mobile Service Component.

More information: Creating a Mobile Service Component

Context

Mobile UI Components always need a Web Dynpro (WD) model which serves as business interaction layer in the Model-View-Controller (MVC) paradigm of WD.

Recommendation

We recommend that you use the controller template in the Composite Development Scenario. This will automatically generate a WD model, component controller context, model binding, supply functions and convenience methods. Then you do not need to create the WD model manually.

SAP NetWeaver Mobile provides two WD model types:

  • Mobile Service Component Model

    This is the WD type used in the Composite Development Scenario. The model classes serve as wrappers to the business logic provided by Mobile Service Components. Thus, all business logic is physically outside of the UI component, ensuring proper layering of the application architecture. The model classes are generated directly from the metadata of the Mobile Service Components.

    This WD model type is recommended as the standard for Mobile Applications for Handhelds.

  • Data Object Model

    This is the WD model type used in the Compact Development Scenario. Model classes represent the data objects from the Data Orchestration Engine (DOE) and are created by importing their metadata. The WD model can be enhanced by adding queries and data structures as dedicated model classes through specialized modeling tools. Custom operations cannot be added as model classes.

    The business logic (in the form of queries) is thus part of the UI component and is not strictly separated from the UI architecturally. More complex business logic (in the form of custom operations) can only be implemented in the component controller, that is directly in the UI.

    This WD model type is suggested for demonstration and prototype applications only.

More information: Development Scenarios for Handheld Applications

Procedure


  1. In the Handhelds UI Explorer , open the context menu of the Model node and choose Create Model .

  2. In the New Model dialog box, you can select between:

    • Mobile Service Component Model

      Choose this model if you are following the Composite Development Scenario, in which the business logic is contained in a Mobile Service Component.

    • Data Object Model

      Choose this model if you are following the Compact Development Scenario.

  3. Enter the Model Name and Model Package .

  4. Select the available entities and the required attributes for each entity.

Results

Model classes are generated for all selected data object nodes, service operations, and data structures. Data object node attributes are generated as model class properties. If required, model class relations are established.