200 likes | 314 Views
Bridging existing Web Modeling Languages to Model-Driven Engineering: A Metamodel for WebML Andrea Schauerhuber, Manuel Wimmer, Elisabeth Kapsammer. Workshop on Model-Driven Web Engineering (MDWE’06) in conj. with ICWE’06 Tuesday, July 11, 2006
E N D
Bridging existing Web Modeling Languages to Model-Driven Engineering:A Metamodel for WebMLAndrea Schauerhuber, Manuel Wimmer, Elisabeth Kapsammer Workshop on Model-Driven Web Engineering (MDWE’06) in conj. with ICWE’06 Tuesday, July 11, 2006 Standford Linear Accelerator Center, Palo Alto, California Andrea Schauerhuber Women’s Postgraduate College for Internet Technologies Institute of Software Technology and Interactive Systems Vienna University of Technology http://wit.tuwien.ac.at
Outline • Motivation • Related Work • Methodology & Conceptual Architecture • Automatic Metamodel Generation • Manual Refactorings • Lessons Learned • Outlook
A Metamodel for WebML Motivation • Most existing Web modeling languages • not fully model-driven, i.e., they often provide code generation facilities, only • but no model transformation or a common format for model exchange • Metamodels or UML Profiles are a prerequisite for model-driven engineering • WebML is a prominent Web modeling language, due to existing tool support (WebRatio) and applications in real world projects • WebML is not specified in terms of a metamodel but in terms of a DTD
Related Work • A metamodel for WebML proposed by [Moreno et al., 2006]Why yet another metamodel for WebML?Developed in parallel, but … • different goals: DSL vs. UML Profile • different methodology: • bottom-up vs. top-down • semi-automatic vs. manual • different application: • transformation of existing WebML XML documents to models vs. models from scratch • Metamodels for other Web modeling languages • UWE [Koch et al., 2003], W2000 [Baresi et al., 2006], Netsilon [Muller et al., 2005] are based on MOF 1.4 • We use new technologies (MOF 2.0, EMF, Ecore, ATL, oaW)
Methodology • Define WebML metamodel semi-automatically • What WebML to use? • WebRatio DTD: used as a basis for automatic generation of a first version of the metamodel • WebRatio functionality: used to manuallyincorporate concepts that could not be captured by the DTD • WebML literature: used to manually refine the generated metamodel Step 1 Step 2
1. Mapping Heuristics TransformationRules 2. «uses» «uses» «uses» Draft Metamodel DTD element type object graph Metamodel element object graph MetaModelGenerator (MMG) <ecore class> <ecore> <ecore class> <ecore att> DTD-Parser Transformer XMI-Serializer «generates» «parses» Semanticenrichment Omondo User Class Class Class Class Class Class MetaModelGenerator (MMG) Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class Class «generates» «parses» The Conceptual Architecture M3 MOF DTD-Grammar Mapping «conformsTo» «conformsTo» M2 WebML DTD WebML Metamodel «conformsTo» «conformsTo» M1 WebML XML Doc WebML Model
Step 1: Automatic Metamodel Generation • XML technical space Model technical space • Various approaches examined [Wimmer et al., 2006] • DTD, XML Schema vs. UML, ER, ORM • Until now no approach to generate MOF-based metamodels from DTDs • Based on these approaches we developed • Set of Transformation Rules • Rules for transforming XMLElementTypes • Rules for transforming XMLAttributes • 3 Heuristics (may not be applicable for all DTDs) • IDREF(S) Resolution • Boolean Identification • Package Identification
ENTITY RELATIONSHIP Step 1: Automatic Metamodel Generation An Example for Transformation Rules & Heuristics • Create classes for XML element types • Create containment references for XML content particles • Create attributes for XML attributes • Apply Heuristic IDREF Resolution DTD Metamodel <!ELEMENT ENTITY (RELATIONSHIP*)> <!ELEMENT ENTITY (RELATIONSHIP*)> ENTITY <!ATTLIST ENTITY id ID #REQUIRED name CDATA #IMPLIED> <!ATTLIST ENTITY id ID #REQUIRED name CDATA #IMPLIED> id:EString name:EString[0..1] entity 1 * relationship <!ELEMENT RELATIONSHIP EMPTY> <!ATTLIST RELATIONSHIP name CDATA #IMPLIED entityIDREF #REQUIRED> <!ATTLIST RELATIONSHIP name CDATA #IMPLIED entity IDREF #REQUIRED> name:EString[0..1] entity:EObject entity
Step1: Output - Metamodel Metrics Metamodel metrics, [Ma et al., 2004]
Manual Refactorings necessary Step 2: Manual Refactoring • DTD deficiencies • Unknown referenced element type(s) • Missing role concept • Awkward cardinalities • XOR constraints • No explicit grouping mechanism • Missing inheritance concept • Limited set of datatypes • No bi-directional associations
Step 2: Manual Refactoring – Example 1 Unknown Referenced Element Type(s) • It is not possible to identify which element type(s) may be referenced from an IDREF-typed attribute • <!ELEMENT Link (…)> • <!ATTLIST Linktype (normal|automatic|transport) ‘normal’ • to IDREF #REQUIRED • …> • <!ELEMENT IndexUnit (…, LINK*,…)> • <!ELEMENT Link (…)> • type (normal|automatic|transport) ‘normal’ • to IDREF #REQUIRED • <!ELEMENT IndexUnit (…, LINK*,…)> to 1 LinkableElement link * to link Link EObject IndexUnit * 1 link type:LinkType DataUnit * link * …
Selector Step 2: Manual Refactoring – Example 2 Missing Role Concept • DTDs do not allow to express that an element type can be deployed in different contexts • <!ELEMENT ConnectUnit • (SourceSelector?, • TargetSelector?,…)> • <!ELEMENT Selector • (SelectorCondition+)> • <!ELEMENT SourceSelector (SelectorCondition+)> • <!ELEMENT TargetSelector (SelectorCondition+)> SourceSelector 0..1 ConnectUnit sourceSelector 0..1 TargetSelector targetSelector
Step 2: Manual Refactoring – Example 3 Awkward Cardinalities • Restricted mechanism of DTDs to specify cardinalities (e.g., 2..5) • <!ELEMENT AlternativePage (Page, Page+)> • <!ATTLIST AlternativePage • … • defaultPage IDREF #IMPLIED • > page Page Alternative Page 1 page 2..* page 1..* defaultPage 0..1
Step 2: Manual Refactoring – Example 4 Missing XOR Constraints • DTDs provide no mechanism to express xor-constraints • <!ELEMENT Area (…,Area*,Page*,…)><!ATTLIST Area…defaultPage IDREF #IMPLIEDdefaultArea IDREF #IMPLIED…> XOR defaultArea {xor} 0..1 0..1 Area Page defaultPage * page area *
Step 2: Manual Refactoring – Example 5 No Explicit Grouping Mechanism WebML <!-- WebML.dtd --> <!ENTITY % StructureDTD SYSTEM "Structure.dtd"> %StructureDTD; <!ENTITY % NavigationDTD SYSTEM “Navigation.dtd"> %NavigationDTD; HypertextOrganization Access Control <!ENTITY % StructureDTD SYSTEM "Structure.dtd"> %StructureDTD; <!ENTITY % NavigationDTD SYSTEM “Navigation.dtd"> %NavigationDTD; <!-- Navigation.dtd --> <!ELEMENT Link (…)> … Content Management Hypertext Navigation <!-- Structure.dtd --> <!ELEMENT Entity (…)> <!ELEMENT Attribute EMPTY> … Structure Content
Step 2: Manual Refactoring – Example 6 Missing Inheritance Concept Hypertext1) link * to Link LinkableElement 1 type:LinkType ContentUnit «enumeration»LinkType - normal - transport - automatic DisplayUnit EntryUnit GetUnit SortableUnit DataUnit HierarchicalIndexUnit MultiChoiceIndexUnit IndexUnit ScrollerUnit MultiDataUnit 1) Please note, that this is only an excerpt from the metamodel. See http://www.big.tuwien.ac.at/projects/webml/index.html for the full specification.
Lessons Learned • DTDs are not appropriate for designing modeling languages • Technical problems • Graphical editors (e.g., Omondo) have difficulties in displaying large models • Manual effort for reorganizing the graphical models (layout) • Eclipse plugins require a lot of memory • Advantages of automatically generating a draft metamodel • Correct translation of concepts and their interrelationships • Visualization of the language fosters understanding • With minimal manual refactorings (IDREF) one is able to obtain metamodel that is equivalent to the original DTD • Models that are equivalent to the original XML documents can be generated. • Metamodel still can be improved and semantically enriched by introducing generalization hierarchies, etc.
Outlook • Open Issues • Extend the WebML Metamodel with WebML concepts that have not been part of the DTD (Web Services, Process Modeling) • OCL constraints for Links • Extend, improve, and evaluate DTD2MOF-Framework • Future Work • Applying Aspect-Orientation to the Model-Driven Development of Ubiquitous Web Applications1 • Integration of Web modeling languages – towards a common understanding in the web modeling field. 1A. Schauerhuber, aspectUWA: Applying Aspect-Orientation to the Model-Driven Development of Ubiquitous Web Applications, Student Extravaganza: Spring School, AOSD'06, Bonn, Germany, March 19, 2006.
References • N. Moreno, P. Fraternalli, and A. Vallecillo. A UML 2.0 Profile for WebML Modeling. Workshop on Model-Driven Web Engineering (MDWE 2006), in conjunction with ICWE'06, Standford Linear Accelerator Center, Palo Alto, California, July 2006. • L. Baresi, S. Colazzo, L. Mainetti, and S. Morasca. W2000: A Modeling Notation for Complex Web Applications. In E. Mendes and N. Mosley (eds.) Web Engineering: Theory and Practice of Metrics and Measurement for Web Development. Springer, 2006. • L. Baresi, F. Garzotto, and M. Maritati. W2000 as a MOF Metamodel. In Proc. of the 6th World Multiconference on Systemics, Cybernetics and Informatics - Web Engineering track. Orlando, USA, July 2002. • N. Koch, A. Kraus. Towards a Common Metamodel for the Development of Web Applications. In Proc. of the 3rd International Conference on Web Engineering (ICWE 2003), July 2003. • P.-A. Muller, P. Studer, F. Fondement, J. Bézivin. Platform independent Web application modeling and development with Netsilon. Software & System Modeling, 4(4), November 2005. • M. Wimmer, A. Schauerhuber, E. Kapsammer, and G. Kramler. From Document Type Definitions to Metamodels: The WebML Case Study. Technical Report. Vienna University of Technology, March 2006. • H. Ma, W. Shao, L. Zhang, Z. Ma, and Y. Jiang. Applying OO Metrics to Assess UML Meta-models. In Proc. of the 7th International Conference on the Unified Modelling Language: Modelling Languages and Applications. Springer-Verlag LNCS 3273, 2004.