5.3 The PIM to Web Transformation

The Web model specifies the definitions of the Web components. The Web components serve HTML content to the user. Each component serves a subset of the classes and associations of the system. Extra details are added to the Web model to define the layout and the user interactions of the HTML pages. In this example, the Web components serve the same classes as in the data schemas of the entity beans.

Web components are defined similarly to EJB components. The served classes and associations are defined in Web data schemas similar to the EJB data schemas. The most important differences are:

  • The data types in the Web model define user presentation and interaction details.

  • In the Web application model there are no key classes; instead, the key classes of the EJB model are referenced.

  • Web actions are added that define actions that can be triggered by the end-user.

The Web data schemas define which information is shown that can be altered by the user. One Web data schema is typically presented to the user in more than one HTML page. A user may create, query, alter, and delete objects from the domain. Which changes the user may execute is defined in properties of the elements of the Web data schemas.

5.3.1 The Transformation Rules

The rules for generating the Web application model from the UML model are almost equal to the ones for generating the EJB application model. Again, we will leave out the words UML and Web whenever the source and target model are clear.

  1. Each class that is not part of another class is transformed into a component and a data schema. The component is set to serve the data schema.

  2. Each class is transformed into a data class residing in a data schema that is generated from the class that is the outer-most composition of the transformed class.

  3. Each association is transformed into an association within a data schema that is generated from the class that is the outer-most composition of the transformed association.

  4. Each association class is transformed into two associations and a data class. The associations and the data class are generated within the data schema that is generated from the class that is the outer-most composition of the class that can navigate across the transformed association class.

  5. Each attribute of a class is transformed into an attribute of the mapped data class.

  6. Each operation is transformed into an operation of the generated Web component that is generated from the class that is the outer-most composition of the class that owns the transformed operation.

Figure 5-4 depicts the Web model generated from the same PIM classes as the EJB model shown in Figure 5-3.

Figure 5-4. Web component model of Rosa's Breakfast Service

graphics/05fig04.gif



MDA Explained. The Model Driven Architecture(c) Practice and Promise 2003
Project Leadership (The Project Management Essential Library)
ISBN: N/A
EAN: 2147483647
Year: 2004
Pages: 118

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net