270 likes | 595 Vues
CS 290C: Formal Models for Web Software Lecture 6: Model Driven Development for Web Software with WebML Instructor: Tevfik Bultan. Model Driven Development (MDD). In MDD approach software development is driven by models Models are written in a software modeling language such as UML
E N D
CS 290C: Formal Models for Web Software Lecture 6: Model Driven Development for Web Software with WebMLInstructor: Tevfik Bultan
Model Driven Development (MDD) • In MDD approach software development is driven by models • Models are written in a software modeling language such as UML • These high level models are systematically translated to concrete implementations • Models provide an abstract, implementation platform independent view of the software system
Model Driven Development • Software development is a modeling activity • Even if the developers do not use any modeling language they have mental models of the problem and the solution they are developing • These models are then translated to code using the abstractions provided by the programming language • MDD adds more layers of abstraction that can be used for modeling both the problem domain and the solution • Different aspects of an application can be modeled using different modeling techniques
Separation of Concerns • MDD promotes separation of concerns • Different modeling techniques are used for modeling different aspects of the application • MDD separates technology dependant concerns from the application logic
Automation • MDD promotes automation • Automated analysis and verification of models • Since models do not contain implementation details they are easier to analyze • Automated code generation from models • Guaranteeing conformance to models • Runtime monitoring based on models • Using runtime monitoring to make sure that the implementation follows the behavior specified in the model • Automated test generation • Models can be used to generate tests for testing the implementation
Model Driven Architecture (MDA) • MDA is supported by the Object Management Group (OMG) • MDA separates the business and application logic from the underlying implementation platform • MDA is a forward engineering approach where first abstract model diagrams are developed which are later transformed to code • The goal of MDA is to separate the conceptual design from the implementation architecture
The MDA approach • First, the developers build platform independent models for the application • uses machine readable design models • uses modeling languages such as UML • These platform independent models document the business functionality of an application • separate from the technology-specific code that implements it • After the implementation platform is chosen • the platform independent models are translated to platform specific models • then the platform specific models are used to guide the implementation for the chosen platform
Platform Independance • The platform independent models enable the business and technological concerns to evolve separately • Models enable interoperability both within and across platform boundaries • models serve as a technology neutral specification of the functionality • Different components of the system can be implemented in different platforms • they can be easily integrated since they all conform to the same design models
MDA Benefits for Software Lifecycle • Implementation: MDA enables integration of new implementation infrastructures based on the existing design models • Integration: Integration is easier since both the implementation and the design models exists at the time of integration. • Maintenance: the availability of the design in a machine-readable form gives developers direct access to the specification of the system, making maintenance much simpler • Testing and simulation: The design models can be validated against requirements and executable models can also be used to simulated the behavior of the system
Web Modeling Language (WebML) • WebML is a modeling language for developing web applications • http://www.webml.org/ • WebML was proposed about 10 years ago • WebML if a modeling language for MDD of web applications • WebML models are high-level, implementation-independent, conceptual models
WebML References • Stefano Ceri, Piero Fraternali, Aldo Bongio: Web Modeling Language (WebML): a modeling language for designing Web sites. Computer Networks 33(1-6): 137-157 (2000) • Stefano Ceri, Piero Fraternali, Maristella Matera: Conceptual Modeling of Data-Intensive Web Applications. IEEE Internet Computing 6(4): 20-30 (2002) • Stefano Ceri, Marco Brambilla, Piero Fraternali: The History of WebML Lessons Learned from 10 Years of Model-Driven Development of Web Applications. Conceptual Modeling: Foundations and Applications 2009: 273-292 • Stefano Ceri et al. Designing Data-Intensive Web Applications, Morgan Kaufmann Series in Data Management Systems.
WebML and WebRatio • There is a spinoff company that has a software tool that generates code from WebML models • http://www.webratio.com/ • WebML models can be translated to implementations using a software tool based on WebML called WebRatio • Separation of concerns • Technological mapping is handled by WebRatio and WebML models are platform independent
WebML • WebML is used to create orthogonal conceptual models: • Data model • Entity-relationship diagrams (UML class diagrams), describes the data schema • Navigation model • Modeling of how information is assembled to pages and linked to each other (hypertext model) • Presentation model • Modeling of the views, page layout • Separation of concerns: data content, interface logic and presentation logic are specified separately
Data Model • The data model is consists of entity-relationship diagrams • similar to UML class diagrams • Identify the data objects that will be stored in the back-end database • The attributes of the data objects • The relations among the data objects
Navigation Model (Hypertext Model in WebML) • Units for publishing content: • Data and index units • Links • Navigation links • Transport links (no navigation, just parameter passing between units) • Automatic links (automatically navigated) • Contextual links transfer data whereas non-contextual links only used for navigation • The semantics of navigation model is based on statecharts • There is a page navigation algorithm which given a WebML navigation model and a user event identifies what the contents of the next page will be
Presentation Model • Enables dressing of the hypertext model to obtain web pages with the desired layout and the look & feel • It allows the use of html templates which are applied to the hypertext model to generate the pages • WebML includes pre-defined presentation style sheets that can be used
Modeling skeleton • Using WebML it is possible to abstract a web application to elementary structures called skeletons (pairs of data and hypertext models) that show a certain aspect of the design • Core skeletons for displaying and managing business objects • Access skeletons for categorizing and selecting concepts • Interconnection skeletons define the relations between the business objects • Content management skeletons