1 / 118

Using MDA ® for designing and implementing Web-based applications

Using MDA ® for designing and implementing Web-based applications. ICWE'04. Nathalie Moreno and Antonio Vallecillo Universidad de Málaga Dept. Lenguajes y Ciencias de la Computación {vergara,av}@lcc.uma.es http://www.lcc.uma.es/~av/. http://www.lcc.uma.es/~av/misConfs/ICWE2004/.

benjy
Télécharger la présentation

Using MDA ® for designing and implementing Web-based applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using MDA® for designing and implementing Web-based applications ICWE'04 Nathalie Moreno and Antonio Vallecillo Universidad de Málaga Dept. Lenguajes y Ciencias de la Computación {vergara,av}@lcc.uma.es http://www.lcc.uma.es/~av/ http://www.lcc.uma.es/~av/misConfs/ICWE2004/

  2. Agenda • Introduction – Models and Metamodels • MDA primer • Web-based Applications • Applying MDA to Web-based Applications • What is left, and what is next • Conclusions MDA4WebApps -- Tutorial @ ICWE 2004

  3. Agenda • Introduction – Models and Metamodels • MDA primer • Web-based Applications • Applying MDA to Web-based Applications • What is left, and what is next • Conclusions MDA4WebApps -- Tutorial @ ICWE 2004

  4. Models and meta-models MDA4WebApps -- Tutorial @ ICWE 2004

  5. What is a Model? • A description of (part of) a system written in a well-defined language. (Equivalent to specification.) [Kleppe, 2003] • A representation of a part of the function, structure and/or behaviour of a system [MDA, 2001] • A description or specification of the system and its environment for some certain purpose. A model is often presented as a combination of drawings and text. [MDA Guide, 2003] • A set of statements about the system. [Seidewitz, 2003] (Statement: expression about the system that can be considered true or false.) MDA4WebApps -- Tutorial @ ICWE 2004

  6. Examples of models • Newtonian models of objects movements in space • City models • Underground and bus maps, commuting models,... • Building/house maps • floor plans, electric wiring, water conductions, central heating pipes, etc. • Software system models • Requirements (use cases) • Structure (class diagrams) • Behavioural models • Choreography models • Load balancing and Deployment models, ... MDA4WebApps -- Tutorial @ ICWE 2004

  7. Characteristics of models [Selic, 2003] • Abstract • Emphasize important aspects, hide irrelevant ones • Understandable • Expressed in a form readily understood by users • Accurate • Faithfully represents the modelled system • Predictive • Can be used to derive correct conclusions about the system • Inexpensive • Cheaper to construct and study than the system MDA4WebApps -- Tutorial @ ICWE 2004

  8. Usefulness of models • Specify the system • Structure, behaviour, ... • Separate concepts at different conceptual levels • Communicate with stakeholders • Understand the system • If existing (legacy applications) • Validate the model • Detect errors and omissions in design ASAP • Mistakes are cheaper at this stage • Prototype the system (execution of the model) • Formal analysis of system properties • Drive implementation • Code skeleton and templates, complete programs (?) MDA4WebApps -- Tutorial @ ICWE 2004

  9. Current limitations of (SE) models • Models are used only as documentation • “Gap” between the model and the implementation of the system • Semantic gap between the respective languages • Changes in the model do not reflect in the code • Changes in the code do not reflect in the model (the model is thrown away after the first implementation, and never updated or used again) • No “merge” of models • Unrelated views of a system (horizontal) • Unrelated towers of models (vertical) • No model “transformations” • Few defined transformation languages • No tools • We are still far behind more mature engineering industries, such as aerospace, automotive and electrical engineering.... ...Even hardware design is ahead of software design! MDA4WebApps -- Tutorial @ ICWE 2004

  10. What is a Metamodel? • A model of a well-defined language [Kleppe, 2003] • A model of models [MDA, 2001] • A model that defines the language for expressing a model [MOF, 2000] • A meta-metamodel is a model that defines the language for expressing a metamodel. The relationship between a meta-metamodel and a metamodel is analogous to the relationship between a metamodel and a model. • A model of a modelling language [Seidewitz, 2003] • That is, a metamodel makes statements about what can be expressed in the valid models of a certain modelling language. MDA4WebApps -- Tutorial @ ICWE 2004

  11. OMG’s Four-layer metamodel architecture • As with Magritte’s picture of the pipe, we need to separate • the “thing” • from the “model” of the thing (I cannot smoke a picture) • from the “language(s)” in which the model is written (“Ceci” is not a pipe) MDA4WebApps -- Tutorial @ ICWE 2004

  12. Four-layers metamodel hierarchy MDA4WebApps -- Tutorial @ ICWE 2004

  13. Four-layers metamodel hierarchy (example) MDA4WebApps -- Tutorial @ ICWE 2004

  14. MOF Metamodel (simplified) MDA4WebApps -- Tutorial @ ICWE 2004

  15. CORBA IDL for the MOF interface ClassClass : ClassifierClass { readonly attribute ClassUList all_of_class_class; Class create_class ( /* from ModelElement */ in ::Model::NameType name, /* from ModelElement */ in ::Model::AnnotationType annotation, /* from GeneralizableElement */ in boolean is_root, /* from GeneralizableElement */ in boolean is_leaf, /* from GeneralizableElement */ in boolean is_abstract, /* from GeneralizableElement */ in ::Model::VisibilityKind visibility, /* from Class */ in boolean is_singleton ) raises (Reflective::MofError); }; // end of interface ClassClass interface Class : ClassClass, Classifier { boolean is_singleton () raises (Reflective::MofError); void set_is_singleton (in boolean new_value) raises (Reflective::MofError); }; MDA4WebApps -- Tutorial @ ICWE 2004

  16. UML 2.0 Infrastructure UML extension mechanisms Boolean, Integer, ... Namespace, Classifier, Relationship, Generalization... Basic definition of Class ... Extended notion of Class, Association,... MDA4WebApps -- Tutorial @ ICWE 2004

  17. New (improved) alignments in 2.0 MDA4WebApps -- Tutorial @ ICWE 2004

  18. Language definition mechanisms MDA4WebApps -- Tutorial @ ICWE 2004

  19. UML 2.0 Profiles • Profiles specialize UML for specific domains • When there is no need to change UML 2.0 metamodel and semantics, just to extend or customize them • Metamodel concept • Defined on metamodel • Used on model • Excellent mechanism for defining MDA “Platforms” • Examples: • OMG standards: • EAI: Enterprise Application Integration • EDOC: Enterprise Distributed Object Computing • CORBA, CCM • Schedulability, Performance and Time • Proprietary: • UML-RT: UML for Real Time MDA4WebApps -- Tutorial @ ICWE 2004

  20. UML 2.0 Profile Example MDA4WebApps -- Tutorial @ ICWE 2004

  21. UML 2.0 Profile Example: EJB Platform MDA4WebApps -- Tutorial @ ICWE 2004

  22. MOF/ QVT (Query-View-Transformations) • Query: Expression evaluated over a model • Results in one or more instances of types (either defined in the source model, or in the query language) • Example 1: List all packages that do not contain child packages • Example 2: Does attribute A of source model have public visibility? • View: A model completely derived from other model • Views are usually read-only • Views are generated by transformations • A query is a restricted kind of view • Transformation: Generates a target model from a source model • Relations and Mappings • Relations specify transformations • Mappings implement transformations • A relation can be refined by one or more mappings MDA4WebApps -- Tutorial @ ICWE 2004

  23. QVT Transformation Requirements • Configurable • Parametrizable • Traceable • Incrementally consistent • Bidirectional • Source-driven, Target-driven, Arbitrary • One-2-One, One-2-Many, Many-2-One, Many-2-Many • Declarative, Imperative, or Hybrid definition • Simple • Scalable • Tool supported (fully or partially) [OMG, 2003] MDA4WebApps -- Tutorial @ ICWE 2004

  24. Agenda • Introduction – Models and Metamodels • MDA primer • Web-based Applications • Applying MDA to Web-based Applications • What is left, and what is next • Conclusions MDA4WebApps -- Tutorial @ ICWE 2004

  25. Beyond technology... • Too many platforms and technologies • Distributed Objects, Components, Web services, ... • Not really interoperable! • Which technology is the best (today)? • Too fast evolution • Technologies evolve... and get obsolete very soon • Which technology will be out tomorrow? • And how long will it last? • How to protect my investment in business logic? • I want my business logic (processes, rules) to be as independent as possible from the supporting technologies • So they can separately evolve........ Without having to start from scratch each time.... And protecting the investment in each one MDA4WebApps -- Tutorial @ ICWE 2004

  26. MDA: a New Kid in Town • New orientation for OMG activities • New step beyond the OMA • A framework for a set of standards in support of MDD • Models are centric! • Target middleware is not important! • Focus on Platform Independent Models (PIM) • Without middleware details • Abstract Platform Specific Models (PSM) • Including all middleware details • Define PIM to PSM transformations MDA4WebApps -- Tutorial @ ICWE 2004

  27. MDA principles • Inspired by: • The widespread public acceptance of UML • OMG moving beyond middleware (CORBA) • The availability of mature MDD technologies • Purpose: • Enable inter-working between complementary tools • Foster specialization of tools and methods • Provide guidance for MDD • MDA overview papers and resources: • http://www.omg.org/mda MDA4WebApps -- Tutorial @ ICWE 2004

  28. MDA (expected) benefits • Protects software investment from technological changes and evolutions • preserves PIMs when new middleware appears! • Allows to handle larger and more complex systems • Through separation of conceptual levels/concerns • Allows the integration of separate aspects from the start, and in a uniform way • security, reliability, performance, ... • Allows legacy systems to be integrated into the MDA chain • Allows simulation and automatic implementation of models MDA4WebApps -- Tutorial @ ICWE 2004

  29. MDA Concepts (1/2) • Architecture • “The architecture of a system is a specification of the parts and connectors of the system and the rules for the interactions of the parts using the connectors” • Viewpoint • “A viewpoint on a system is a technique for abstraction using a selected set of architectural concepts and structuring rules, in order to focus on particular concerns within that system” • View • “A viewpoint model or view of a system is a representation of that system from the perspective of a chosen viewpoint” • Implementation • “An implementation is a specification, which provides all the information needed to construct a system and to put it into operation” MDA4WebApps -- Tutorial @ ICWE 2004

  30. MDA Concepts (2/2) • Platform • “A set of subsystems/technologies that provide a coherent set of functionality through interfaces and specified usage patterns that any subsystem that depends on the platform can use without concern for the details of how the functionality provided by the platform is implemented.” • Platform Independent Model (PIM) • “A model of a subsystem that contains no information specific to the platform, or the technology that is used to realize it.” • Platform Specific Model (PSM) • “A model of a subsystem that includes information about the specific technology that is used in the realization of it on a specific platform, and hence possibly contains elements that are specific to the platform.” MDA4WebApps -- Tutorial @ ICWE 2004

  31. MDA models (1/2) • Computation Independent Model (CIM) • A view from a system from the Computational Independent Viewpoint. • A CIM Focuses on the system and its environment; the details of the structure of the system are hidden or as yet undetermined. • A CIM is sometimes called a domain model or a business model, and is specified using a vocabulary that is familiar to the practitioners of the domain in question • It may hide much or all information about the use of automated data processing systems. • Platform Independent Model (PIM) • A platform independent model is a view of a system from the platform independent viewpoint. A PIM exhibits platform independence and is suitable for use with a number of different platforms of similar type. MDA4WebApps -- Tutorial @ ICWE 2004

  32. MDA models (2/2) • Platform Specific Model (PSM) • A platform specific model is a view of a system from the platform specific viewpoint. • A PSM combines the specifications in the PIM with the details that specify how that system uses a particular type of platform. • Platform Model (PM) • A platform model provides a set of technical concepts, representing the different kinds of parts that make up a platform and the services provided by that platform. • It also provides, for use in a platform specific model, concepts representing the different kinds of elements to be used in specifying the use of the platform by an application. MDA4WebApps -- Tutorial @ ICWE 2004

  33. Examples of MDA models • CIM • “Priority must be given to shipping the oldest deliverables” • PIM • “The Deliverables are ordered according to date for shipment” • PSM/OOD • “Deliverables are sorted for shipment() in increasing order, using their attribute date” • PSM/OOP • “Use quicksort() to sort Deliverables, using Deliverable.date as sorting key, before passing them to shipment()” MDA4WebApps -- Tutorial @ ICWE 2004

  34. Model transformations: MDA Pattern • Model transformation is the process of converting one model to another model of the same system • The MDA pattern includes (at least): • a PIM, • a Platform Model, • a Transformation, and • a PSM MDA4WebApps -- Tutorial @ ICWE 2004

  35. Examples of MDA transformations UML Model (PIM) XMI Document (PSM) <Auto> <Color> Red </Color> <Door> 4 </Door> <Engine> 2 </Engine> </Auto> XMI M O F IDL, Java… (PSM) X M I XMI DTD, Schema (PSM) interface Auto { }; Class Auto {public String color; public int Door; public int Engine; } <!Element Auto (Color*, Door*, Engine*)> MDA4WebApps -- Tutorial @ ICWE 2004

  36. Applying the MDA pattern: 1) Marking UML Profiles can be used to define the marks and for marking PIMs MOF QVT languages will define the mappings MDA4WebApps -- Tutorial @ ICWE 2004

  37. Model mappings and marks • Mappings • An MDA mapping provides specifications for transformation of a PIM into a PSM for a particular platform. The platform model will determine the nature of the mapping • Marks • Model instance mappings define marks • A mark represents a concept in the PSM, which can applied to an element of the PIM to indicate how that element is to be transformed • Templates • A mapping may also include templates, which are parameterised models that specify particular kinds of transformations • These templates are like design patterns, but may include much more specific specifications to guide the transformation MDA4WebApps -- Tutorial @ ICWE 2004

  38. Example of the result of a mapping interface MyClass { int getAttributeOne(); void setAttributeOne(int v); int oneOperation(); } MDA4WebApps -- Tutorial @ ICWE 2004

  39. Result of a transformation template using a SecurityProfile (example) MDA4WebApps -- Tutorial @ ICWE 2004

  40. Marks • Marks distinguish multiple possible targets • Kinds of marks • Discriminators and enumerators [ isRemote | isBoolean ] • Quantities ( if ( numInstances < Q and frequency < F) LinkedList | HashTable ) • Inputs ( append “db_” to all operation names ) • ... Local Invocation Invocation <<isLocal>> <<isRemote>> PIM PSM Remote Invocation [Mellor, 2003] MDA4WebApps -- Tutorial @ ICWE 2004

  41. Applying the MDA pattern: 2) Metamodel transformation MOF QVT languages define the transformations MDA4WebApps -- Tutorial @ ICWE 2004

  42. MDA Transformations — detailed [Bezivin, 2004] MDA4WebApps -- Tutorial @ ICWE 2004

  43. Example of transformation XML Element name: String Attribute name: String value: String UML Attribute name: String type: String AtoX MDA4WebApps -- Tutorial @ ICWE 2004

  44. The relation and the mapping relation AtoX { domain { (UML.Attribute) [name = n, type = t] } domain { (XML.Element) [ name = "Attribute", attrs = { (XML.Attribute) [name = "name", value = n], (XML.Attribute) [name = "type", value = t] } ] } } mapping MAtoX refines AtoX { domain { (UML.Attribute) [name = n, type = t] } body { (XML.Element) [ name = "Attribute", attrs = { (XML.Attribute) [name = "name", value = n], (XML.Attribute) [name = "type", value = t] } ] } } MDA4WebApps -- Tutorial @ ICWE 2004

  45. A transformation rule (1/2) TransformationClassToClass (UML, UML) { source c1: UML::Class; target c2: UML::Class; source condition-- none target condition-- none mappingtryPublicToPrivateAttributeon c1.features <~> c2.features; -- everything else remains the same } TransformationPublicToPrivateAttribute (UML, UML) { source sourceAttribute : UML::Attribute; target targetAttribute : UML::Attribute; getter : UML::Operation; setter : UML::Operation; source conditionsourceAttribute.visibility = VisibilityKind::public; MDA4WebApps -- Tutorial @ ICWE 2004

  46. Transformation rule (2/2) target conditiontargetAttribute.visibility = VisibilityKind::private and-- define the set operation setter.name = 'set'.concat(targetAttribute.name) andsetter.parameters->exists( p | p.name = 'new'.concat(targetAttribute.name) and p.type = targetAttribute.type ) and setter.type = OclVoid and-- define the get operation getter.name = 'get'.concat(targetAttribute.name) and getter.parameters->isEmpty() and getter.returntype = targetAttribute.type; mappingtryStringToStringon sourceAttribute.name <~> targetAttribute.name; tryClassifierToClassifieron sourceAttribute.type <~> targetAttribute.type; } [Kleppe, 2003] MDA4WebApps -- Tutorial @ ICWE 2004

  47. Applying a transformation “template” MDA4WebApps -- Tutorial @ ICWE 2004

  48. Applying the MDA pattern: 3) Model merging MDA4WebApps -- Tutorial @ ICWE 2004

  49. Applying the MDA pattern: 4) Additional information • Example. A particular architectural style may be specified: information may be added to connectors to specify quality of service. MDA4WebApps -- Tutorial @ ICWE 2004

  50. Applying the MDA Pattern several times • The MDA pattern can be [has to be usually]applied several times in succession • What is a PSM resulting from one application of the pattern, will be a PIM in the next application MDA4WebApps -- Tutorial @ ICWE 2004

More Related