WebRatio Projects
From WebRatio WebML Wiki
|
Contents |
Introduction
Web applications are usually structured according to the MVC Pattern. The MVC Pattern logically splits the application in three tiers:
- Model: is the domain-specific representation of the data on which the application operates. Domain logic adds meaning to raw data (for example, calculating whether today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items). Many applications use a persistent storage mechanism (such as a database) to store data. MVC does not specifically mention the data access layer because it is understood to be underneath or encapsulated by the model.
- View: renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes.
- Controller: Processes and responds to events (typically user actions) and may indirectly invoke changes on the model.
The MVC Pattern can be considered also as an architectural pattern. When considered as architectural pattern, MVC splits an application into separate layers that can be analyzed, and sometimes implemented, separately. By decoupling models and views, MVC helps to reduce the complexity in architectural design and to increase flexibility and reuse of code. Available technologies and frameworks for developing Web applications are designed according to the MVC pattern (normally, the Controller, the Model and the View are developed in separated phases) but without a complete separation between the three layers (the user interface is designed according to the functionalities of the application, and a change in a layer has consequences in the other layers).
WebRatio Projects
WebRatio brings the MVC pattern to it's full power, both as design and architectural pattern, by splitting the application in three different projects. Each project addresses a particular aspect of the application (the Model, the Controller, the View) independently.
Every project defines a well-defined part of the application and put together, a Web Project, one or more Style Projects and one or more Units Projects define every characteristic of an application.
- Web Project: contains the WebML definition of the application
- Style Project: contains the layout definition of the application
- Units Project: contains all the definitions of the custom elements of the application
The Web Project can use the Custom Units defined in the Units Project to define the functionalities of an application. The Style project gives a layout to every element contained in the Web Project, defining the look & feel of the generated application.
Due to the separation between logic and layout, it's possible to use Units and Style Projects with several Web Projects with no integration effort. In this way the reusability of every element is granted, minimizing the application development time.
Web Project
A Web Project represents the Model (in the Data Model) and the Controller (in the Web Model) tiers of the MVC pattern. The project includes information about the Data Model and about the Web Model elements. This information is constantly updated as the user changes the model.
Data Model
The Data Model is a conceptual schema which conveys the available knowledge about the application data. Designing such a schema is preliminary both to the design of the business functions that operate on the data, and to the implementation of the physical structures supporting data storage, update and retrieval. The Data Model describes the conceptual data organization; it is compatible with the Entity-Relationship model and UML class diagrams. In the Data Model is defined the structure of all the data used in the application. The conceptual data model used in WebML includes various Data Model Elements:
- Entity
- Attribute
- Generalization
- Sub Entity
- Relationship
- Property
- Sub Type
This conceptual definition is then mapped on physical sources such as databases or on volatile sources, used at runtime (see The Data Model Mapping for more details).
For further details on the Data Model see the Data Model section.
Web Model
The Web Model consists of the definition of every functional aspect of the application (pages, operations, views, services, ...) using WebML. The Web Model is organized in a hierarchy of several elements each of them represents a defined part of the application. Each Web Model element is a container of a WebML definition of a part of the application.
Site View
A Site View is characterized by a user-defined name and contain a set of areas and / or Pages devoted to fulfilling the requirements of one or more user groups.
Module View
A Module View is a collection of modules which contain the reusable operation/content units, operation groups and pages.
Service View
A Service View is a collection of ports which exposes the functionality of a Web Service or a collection of Jobs, modeled through operations
For further details on the Web Model see the Web Model section.
Units Project
The Units Project cooperates with Web Projects to realize the Controller tier of the MVC pattern. A Units Project contains a set of custom units and their definitions. A Custom Unit is written in Java and realizes a defined task not included in the WebRatio standard Units functionalities. The definition of Custom Units is modular and once is defined with it's inputs and outputs, can be used in every Web Project as a normal Unit. With the Custom Unit it's possible to extend the set of Units available for the Web Model definition.
For further details on the Units Project see the Units Project section.
Style Project
Finally, the View tier of the MVC pattern is realized with the Style Project. A Style project contains the layout templates needed to generate the graphical elements of your Web Application. The templates defines the graphic rendition of every Web Model element, such as pages, units, links, etc.. Every template is developed in a modular way, in order to cooperate with every model, without concerning of the actual data structure to be displayed. According to this, a template (e.g. a Data Unit Template) can be used to display several elements (e.g. several Data Units in several Web Projects, based on different Entities), due to the fact that a template defines the graphic of a general element and the generation process fit it to the actual model.
A Style Project can contain different kinds of templates:
- Page Layout template
- Grid Layout template
- Cell Layout template
- Frame Layout template
- Unit Layout template
- Attribute Layout template
- Field Layout template
- Link Layout template
For further details on the Style Project see the Presentation section.
