Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Modeling the Linguistic Architecture of Software Products

Modeling the Linguistic Architecture of Software Products

Andrei Varanovich

October 12, 2012
Tweet

Other Decks in Research

Transcript

  1. Modeling the Linguistic Architecture of Software Products Jean-Marie Favre (University

    of Grenoble, France) Ralf Lämmel, Andrei Varanovich (University of Koblenz-Landau, Germany) © 2012, 101companies Friday, October 12, 12
  2. A typical software project programming languages (e.g., Java, PHP, JavaScript,

    or Python) DSLs (e.g., CSS, XSLT, or SQL) library-based languages (e.g., JQuery, DOM API) configuration languages (e.g., Hibernate mapping) models schemas models “many” languages and technologies “somehow” related © 2012, 101companies Friday, October 12, 12
  3. Software architecture • The software architecture of a system is

    the set of structures needed to reason about the system, which comprise software elements, relations among them, and properties of both [Clements, Paul; Felix Bachmann, Len Bass, David Garlan, James Ivers, Reed Little, Paulo Merson, Robert Nord, Judith Stafford (2010). Documenting Software Architectures: Views and Beyond, Second Edition. Boston: Addison-Wesley.] viewpoints in the IEEE 1471/42010 ontology: • Functional/logical viewpoint • Code/module viewpoint • Development/structural viewpoint • Concurrency/process/runtime/thread viewpoint • Physical/deployment/install viewpoint • User action/feedback viewpoint • Data view/data model None of the viewpoints focuses on the “linguistic” aspect © 2012, 101companies Friday, October 12, 12
  4. Goal: Develop a megamodeling approach that is useful for understanding

    the linguistic architecture of software products supported by the MegaL language and the tool suite •megamodeling must help with managing diversity and heterogeneity of software technologies •сognitive value is important! [Some] motivations: Empirical Assessment of MDE in Industry by John Hutchinson, Jon Whittle, Mark Rouncefield and Steinar Kristoffersen © 2012, 101companies Friday, October 12, 12
  5. A megamodel is a model of which at least some

    elements represent and/or refer to models or metamodels. Bezivin, J., Jouault, F., Valduriez, P.: On the need for Megamodels. In: Proceedings of the OOPSLA/GPCE: Best Practices for Model- Driven Software Development workshop (2004) Friday, October 12, 12
  6. © 2012, 101companies The notion of megamodel • Megamodels are

    (ER) models. • Entities of interest ‣ Languages ‣ Technologies (components thereof) ‣ Programs ‣ ... • Relationships of interest ‣ Conformance ‣ Transformation ‣ ... Friday, October 12, 12
  7. © 2012, 101companies That’s a megamodel, too! http://en.wikipedia.org/wiki/Tombstone_diagram All relations

    are implicit Bootstrapping a C compiler written in C, by compiling it using another compiler written in machine code. Friday, October 12, 12
  8. © 2012, 101companies Yet another megamodel! ATL Documentations ! !

    ATL Starter’s Guide Date 07/12/2005 MMM MM t M a M b MM a M t MM b conformsTo conformsTo conformsTo conformsTo conformsTo conformsTo Transformation MMM MMM MM t MM t M a M a M b M b MM a MM a M t M t MM b MM b conformsTo conformsTo conformsTo conformsTo conformsTo conformsTo Transformation Figure 1. An overview of model transformation Figure 1 summarizes the full model transformation process. A model Ma , conforming to a metamodel MMa , is here transformed into a model Mb that conforms to a metamodel MMb . The transformation is defined by the model transformation model Mt which itself conforms to a model transformation metamodel MMt . This last metamodel, along with the MMa and MMb metamodels, has to conform to a metametamodel (such as MOF or Ecore). 3 A simple transformation example This section introduces the transformation example that is going to be developed in the document. The aim of this first example is to introduce users with the basic concepts of the ATL programming. To this end, this example considers two similar metamodels, Author (Figure 2) and Person (Figure 3), that both encode data relative to persons. http://wiki.eclipse.org/ATL/Concepts#Model_Transformation Model transformations with ATL Friday, October 12, 12
  9. © 2012, 101companies Yet another megamodel! ATL Documentations ! !

    ATL Starter’s Guide Date 07/12/2005 MMM MM t M a M b MM a M t MM b conformsTo conformsTo conformsTo conformsTo conformsTo conformsTo Transformation MMM MMM MM t MM t M a M a M b M b MM a MM a M t M t MM b MM b conformsTo conformsTo conformsTo conformsTo conformsTo conformsTo Transformation Figure 1. An overview of model transformation Figure 1 summarizes the full model transformation process. A model Ma , conforming to a metamodel MMa , is here transformed into a model Mb that conforms to a metamodel MMb . The transformation is defined by the model transformation model Mt which itself conforms to a model transformation metamodel MMt . This last metamodel, along with the MMa and MMb metamodels, has to conform to a metametamodel (such as MOF or Ecore). 3 A simple transformation example This section introduces the transformation example that is going to be developed in the document. The aim of this first example is to introduce users with the basic concepts of the ATL programming. To this end, this example considers two similar metamodels, Author (Figure 2) and Person (Figure 3), that both encode data relative to persons. http://wiki.eclipse.org/ATL/Concepts#Model_Transformation Model transformations with ATL What to think of this part? Friday, October 12, 12
  10. © 2012, 101companies That’s nearly the same megamodel. odel-Driven Engineering

    33 Transformation TransformationMetamodel TransformationModel Metametamodel Metamodel Metamodel Model Model conforms to conforms to conforms to conforms to conforms to conforms to source + target + represented by source + target + Figure 2.6: Model transformation megamodel ns in the Object Constraint Language1 (OCL) to select the elements ource model to transform. OCL is a declarative language, originally Bas Graaf: Model-Driven Evolution of Software Architectures, Dissertation, Delft University of Technology, 2007. Model transformations Friday, October 12, 12
  11. © 2012, 101companies That’s nearly the same megamodel. odel-Driven Engineering

    33 Transformation TransformationMetamodel TransformationModel Metametamodel Metamodel Metamodel Model Model conforms to conforms to conforms to conforms to conforms to conforms to source + target + represented by source + target + Figure 2.6: Model transformation megamodel ns in the Object Constraint Language1 (OCL) to select the elements ource model to transform. OCL is a declarative language, originally Bas Graaf: Model-Driven Evolution of Software Architectures, Dissertation, Delft University of Technology, 2007. Model transformations Is this is a function or an application thereof? Friday, October 12, 12
  12. X/O Mapping in .NET XML Schema Definition Tool (Xsd.exe) generates

    XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly. XSD to Classes Generates runtime classes from an XSD schema file. The generated classes can be used in conjunction with System.XML.Serialization.XMLSerializer to read and write XML code that follows the schema. Friday, October 12, 12
  13. © 2012, 101companies Megamodel for X/O mapping in .NET doc

    and xmlTypes hold the same “information capacity” both (metamodel and model) are transformed obj and ooTypes hold the same “information capacity” Formally valid. But comprehensive? [early version] Friday, October 12, 12
  14. © 2012, 101companies Megamodel of O/X mapping with xsd.exe Language

    XSD, CSharp, XML, ClrObjectGraphs . local Language CSharpFromXsd subsetOf CSharp . variable File+ xmlTypes elementOf XSD . variable File+ ooTypes elementOf CSharpFromXsd . variable File xmlDoc elementOf XML . variable ObjectGraph clrObj elementOf ClrObjectGraphs . local Function classgen : XSD -> CSharpFromXsd . local Function deserialize : XML -> ClrObjectGraphs . xmlDoc conformsTo xmlTypes . clrObj conformsTo ooTypes . classgen(xmlTypes) |-> ooTypes . deserialize(xmlDoc) |-> clrObj . Refined MegaL/TXT: Friday, October 12, 12
  15. © 2012, 101companies Research questions • Does a general megamodeling

    language exist? ‣ What are the entities of linguistic architecture? Friday, October 12, 12
  16. © 2012, 101companies Research questions • Does a general megamodeling

    language exist? ‣ What are the entities of linguistic architecture? ‣ What are the relationships of interest? Friday, October 12, 12
  17. © 2012, 101companies Research questions • Does a general megamodeling

    language exist? ‣ What are the entities of linguistic architecture? ‣ What are the relationships of interest? ‣ (What is a good visual syntax?) Friday, October 12, 12
  18. © 2012, 101companies Research questions • Does a general megamodeling

    language exist? ‣ What are the entities of linguistic architecture? ‣ What are the relationships of interest? ‣ (What is a good visual syntax?) • How to validate megamodels? Friday, October 12, 12
  19. © 2012, 101companies Prerequisites In our study: http://101companies.org the catalog

    of implementations with the structured documentation and related classification (taxonomy) of programming languages and technologies Any other domain vocabulary and classification can be used We don’t redefine languages and technologies! We model their relationships in complex software products Friday, October 12, 12
  20. © 2012, 101companies “Software product” Defined by 101companies feature model:

    http://101companies.org/index.php/Category:101feature Includes “cut” and “total” salaries operations Deals with companies (HR domain) http://101companies.org/index.php/101implementation:xsdClasses Implementation using X/O mapping for .NET: https://github.com/101companies/101repo/tree/master/contributions/xsdClasses Source code: Friday, October 12, 12
  21. © 2012, 101companies Fig. 1. The linguistic architecture of a

    software product when displayed with the Me- gaL/Explorer tool. Demo http://black42.uni-koblenz.de/production/101worker/MegaModels/implementations/xsdClasses/ Friday, October 12, 12
  22. © 2012, 101companies Linked megamodels An entity is linked to

    a unique resource that can be browsed and examined correspondsTo Friday, October 12, 12
  23. © 2012, 101companies MegaL/RDF: Exposing megamodels _:xmlTypes  rdf:type  mgl:File  .

    _:xmlTypes  rdfs:label  "xmlTypes"  . _:xmlTypes  mgl:elementOf  lang:XSD  . _:xmlTypes  mgl:inputOf  _:classgen  . _:xmlDoc  rdf:type  mgl:File  . _:xmlDoc  rdfs:label  "xmlDoc"  . _:xmlDoc  mgl:elementOf  lang:XML  . _:xmlDoc  mgl:conformsTo  _:xmlTypes  . _:xmlDoc  mgl:inputOf  _:classgen  . mgl: MegaL ontology which contains definitions for both entity types (represented as OWL classes) and relationships types (represented as OWL proper-ties). rdf, rdfs: RDF and RDFS definitions enables the integration of megamodels and various other (related resources in the Linked Data global data space. Friday, October 12, 12
  24. © 2012, 101companies MegaL -- summary • Entities and relationships

    • Types relate to 101companies ontology • Actual entities or placeholders thereof • MegaL/yEd: visual notation • MegaL/Txt: textual notation • MegaL/RDF: RDF representation • Binding: Turn placeholders into entities • Linking: Link online artifacts to entities Friday, October 12, 12