Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
© 2012, 101companies
Megamodels as models of the linguistic architecture of software
products and software technologies
Ralf Lämmel (Software Languages Team) on behalf ofJean-Marie Favre, Thomas Schmorleiz, and Andrei Varanovich
19 April 2012
http://101companies.org
© 2012, 101companies
Speaker bio Ralf Lämmel
• Professor of CS at University of Koblenz-Landau
• Leader of the Software Languages Team @ Koblenz
• Co-founder of SLE conference series
• Co-founder of GTTSE summer school series
• Previous jobs: MSFT, VU (A’dam), CWI, Uni Rostock
• Interests: languages, grammars, software language engineering, software linguistics, transformations, automation, lambdas, programs, technologies, understanding, ...
Casualty of social networks
© 2012, 101companies
Context: Technical space travel for developers,
researchers, and educators in the 101companies project.
© 2012, 101companies
Technical space travel for developers, researchers, and educators
What’s a technical space?
© 2012, 101companies
Technical space= Technology and community context
in software engineering
• Objectware (more specifically: Javaware)
• Modelware
• Grammarware
• XMLware
• Ontoware
• Tableware (aka Tupleware, Dataware)
• ...
© 2012, 101companies
Technical space travel for developers, researchers, and educators
What’s technical space travel?
© 2012, 101companies
Technical space travel
• Abstractly:
‣ Handle multiple technical spaces simultaneously
‣ Less dramatically
• Handle multiple technologies simultaneously
• Acquire skills for a new technology
• Concretely:
‣ Master Object/Relational/XML mapping
‣ Master domain-specific languages
© 2012, 101companies
Too much technologies. Too little time.EMF
SQL
TENEO
Java
XSD
DOM
Antlr
OWL
UML
XMI
Ecore
SQL DDL
XLSTSaxon
Hibernate
Awk
Json
Yacc
JAXP
RestOWL
RDF
ATOM
SparQLXSLT
DTD
BNF
XSD
OCL
Prolog
grep
MOF
OMG
QVT
jDOMRose
Protegé
XQuery
ODM
XMLSpy
JPA
JAXB
JDBC
ODBC
MySQLArgoUML
Jean
Jena
Jena
Ralf
Dragan
TXL
VLDB
EMF.gen
ORACLE
TCS
XText
Teneo
Jersey
GWT
Sesame
Stratego
XPATH
JeanBeans
UTF8
ASCII
RDFa
RDF(S)
RDFS
CFG
LALR
ER
SLE2010xerces
xalan
saxonsax
sed
XSD
JMI JMF
SBVR
© 2012, 101companies
EMF
SQL
TENEO
Java
XSD
DOM
Antlr
OWL
UML
XMI
Ecore
SQL DDL
XLSTSaxon
Hibernate
Awk
Json
Yacc
JAXP
RestOWL
RDF
ATOM
SparQLXSLT
DTD
BNF
XSD
OCL
Prolog
grep
MOF
OMG
QVT
jDOMRose
Protegé
XQuery
ODM
XMLSpy
JPA
JAXB
JDBC
ODBC
MySQLArgoUML
Jean
Jena
Jena
Ralf
Dragan
TXL
VLDB
EMF.gen
ORACLE
TCS
XText
Teneo
Jersey
GWT
Sesame
Stratego
XPATH
JeanBeans
UTF8
ASCII
RDFa
RDF(S)
RDFS
CFG
LALR
ER
SLE2010xerces
xalan
saxonsax
sed
XSD
JMI JMF
SBVR
Issues with software technologies
• Silos of knowledge• Combining technologies• Complexity of technologies• Entering a new space• Teaching technologies
© 2012, 101companies
Technical space travel for developers, researchers, and educators
Developers may need to travel like this.How do we care as researchers?How do we care as educators?
© 2012, 101companies
Why would you study computer science, if your ultimate destiny is
to get lost in space and technology?
The student-centric view
© 2012, 101companies
Popular faculty opinion 1
Practice is terribly complex.University should not bother.
© 2012, 101companies
Popular faculty opinion 2
Practice is too complex.University can not bother.
© 2012, 101companies
Popular faculty opinion 3
Practice is incidentally complex.University must not bother.
© 2012, 101companies
Proposed opinion shift
Practice is amazingly complex and does not go away.University and research should, can, and must bother and help.
© 2012, 101companies
Technical space travel for developers, researchers, and educators
http://www.fotocommunity.de/pc/pc/display/18564779
Tim
e to
let
the
cat
out
of t
he b
ag.
© 2012, 101companies
EMF
SQL
TENEO
Java
XSD
DOM
Antlr
OWL
UML
XMI
Ecore
SQL DDL
XLSTSaxon
Hibernate
Awk
Json
Yacc
JAXP
RestOWL
RDF
ATOM
SparQLXSLT
DTD
BNF
XSD
OCL
Prolog
grep
MOF
OMG
QVT
jDOMRose
Protegé
XQuery
ODM
XMLSpy
JPA
JAXB
JDBC
ODBC
MySQLArgoUML
Jean
Jena
Jena
Ralf
Dragan
TXL
VLDB
EMF.gen
ORACLE
TCS
XText
Teneo
Jersey
GWT
Sesame
Stratego
XPATH
JeanBeans
UTF8
ASCII
RDFa
RDF(S)
RDFS
CFG
LALR
ER
SLE2010xerces
xalan
saxonsax
sed
XSD
JMI JMF
SBVR
• Silos of knowledge• Combining technologies• Complexity of technologies• Entering a new space• Teaching technologies?
Issues with software technologies
• analogies• examples• abstractions
In need of ...
© 2012, 101companies
•Analogies
• Examples
• Abstractions
© 2012, 101companies
MOF XSD RDFS SQL.DDL EBNF
OCLXPath
QVT
XQuery SPARQL SQL
ProtégéTopbeard
XMLSpyVS-XML
ArgoUMLRose
MySQLOracle
XSLT TXLASF
MetaEnv.
XMLVLDB
MoDELSECMDA
ICSWESWC
VLDBSIGMOD
CCPOPL
Metalanguage
Navigation
Query
Transfo.
Toolkit
Conferences
Modelware XMLware Ontoware Tableware Grammarware
Sesame
© 2012, 101companies
Analogy in space travel
XMIModelware XMLware
Javaware
JDBC
Dataware
JDOM
Ontoware
JenaHibernate
EMF.genJMITeneo JAXB
JPA
© 2012, 101companies
Use of an ontology (taxonomy) for the organization of technologies and languages
21
© 2012, 101companies
Use of an ontology (taxonomy) for the organization of technologies and languages
22
© 2012, 101companies
• Analogies
•Examples
• Abstractions
© 2012, 101companies
Implement many Human Resources Management Systems
Company X:Swing + JDBC
Company Y:SWT + Hibernate
Company Z:GWT + MongoDB
...
Many different implementations
(and specifications) of about the
same, in fact, feature-wise differing
human-resources management
system using different software
technologies and software languages.
http://101companies.org
© 2012, 101companies
Basic data model of the HRMS
© 2012, 101companies
Demo
$ pwd
/Users/laemmel/101companies/contributions/html5local
$ open index.html
© 2012, 101companies
Basic features of the HRMS
Total salaries
Cut salaries
Serialize companies
© 2012, 101companies
The feature model of the HRMS
Total salaries
Cut salaries
Persist companies
Parallelize operations
All features are optional.
© 2012, 101companies
Distribution of files for 101companies implementations
# F
iles
Implementations
© 2012, 101companies
Distribution of LOC for 101companies implementations
LOC
Implementations
© 2012, 101companies
Technologies used in 101companies implementations
© 2012, 101companies
Languages used in 101companies implementations
© 2012, 101companies
Demo
© 2012, 101companies
Plan for the demo
• Start at 101companies landing page.
• Enter search string HTML5
• Browse github for HTML5 implementation
• Explore wiki:‣ Themes of implementations
• The Web programming theme
• The Java mapping theme‣ Feature model‣ Ontology
• Show resources
© 2012, 101companies
• Analogies
• Examples
•Abstractions
© 2012, 101companies
What is the essence of technology xyz?
© 2012, 101companies
Summary: why is 101companies important and how to contribute?
Think of SE/PL courses
Technology adoption
Semantic web
Compare to Stack Overflow
Compare to Wikipedia
© 2012, 101companies
Meat: Megamodels as models of the linguistic architecture of software products and
software technologies.
© 2012, 101companies
What’s a megamodel?
UsesMegaL/yEd
© 2012, 101companies
What’s a megamodel?
UsesMegaL/yEd
© 2012, 101companies
The notion of megamodel
• Megamodels are (ER) models.
• Entities of interest‣ Languages‣ Technologies (components thereof)‣ Programs‣ ...
• Relationships of interest‣ Conformance‣ Transformation‣ ...
© 2012, 101companies
That’s a megamodel, too!
http://en.wikipedia.org/wiki/Tombstone_diagram
© 2012, 101companies
Yet another megamodel!ATL Documentations !
! ATL Starter’s Guide Date 07/12/2005
Page 2!
MMM
MMt
Ma Mb
MMa
Mt
MMb
conformsTo
conformsTo conformsTo
conformsTo
conformsTo
conformsTo
Transformation
MMMMMM
MMtMMt
MaMa MbMb
MMaMMa
MtMt
MMbMMb
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.
Figure 2. The Author metamodel
Figure 3. The Person metamodel
Both metamodels are composed of a single eponym element: Author for the Author metamodel and Person for the Person metamodel. Both entities are characterized by the same couple of string properties (name and surname). The objective is here to design an ATL transformation enabling to generate a Person model from an Author model. The transformation to be designed will have to implement the following (obvious) semantics:
• A distinct Person element is generated for each source Author element; o The name of the generated Person has to be initialized with the name of the source
Author; o The surname of the generated Person has to be initialized with the name of the
source Author.
http://wiki.eclipse.org/ATL/Concepts#Model_Transformation
Model transformations
with ATLWhat to think of this part?
© 2012, 101companies
That’s nearly the same megamodel.2.3. Model-Driven Engineering 33
Transformation
TransformationMetamodel
TransformationModel
Metametamodel
MetamodelMetamodel
Model Model
conforms to
conforms to
conforms toconforms to
conforms to
conforms to
source+
target+
represented bysource+target+
Figure 2.6: Model transformation megamodel
pressions in the Object Constraint Language1 (OCL) to select the elementsin the source model to transform. OCL is a declarative language, originallydeveloped to specify constraints over UML models.
The MDE pattern or megamodel for model transformations is depictedin Figure 2.6 [Bézivin et al., 2005]. With MDE a Transformation between asource and target Model is defined by a transformation language. Whenthis language is defined by a TransformationModelMetamodel, the transforma-tion definition is in fact a model itself. This TransformationModel specifiestransformations of source into target models in terms of the Metamodelsthey conform to. In correspondence with the metamodelling megamodel inFigure 2.3 on page 30, all involved metamodels conform to a single Metameta-
model.
A transformation engine (automatically) transforms source models thatconform to the source metamodel into target models that conform to thetarget metamodel as described in the transformation definition. As such,transformation engines require several inputs: source model, source meta-model, target metamodel, and transformation definition.
Many different types of model transformations and model transfor-mation languages are conceivable. Sendall [2003]; Czarnecki and Helsen[2006]; and Mens and Van Gorp [2006] each give a number of propertiesof model transformation languages. These include the type and numberof source and target models, horizontal vs. vertical transformations (withrespect to abstraction level), type of notation (e.g., graphical vs. textual),source-target relationship (new vs. in-place), and many more.
1http://www.omg.org/technology/documents/modeling_spec_catalog.htm#OCL (June 2007)
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?
© 2012, 101companies
Megamodel of O/X mapping with xsd.exe
UsesMegaL/yEd
http://softlang.uni-koblenz.de/mega/
© 2012, 101companies
Megamodel of a software product
UsesMegaL/yEd
© 2012, 101companies
Research questions
• Can we do heavy lifting with megamodeling?
• 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?
© 2012, 101companies
Heavy lifting with megamodeling
Claim by this speaker:
Megamodeling lifts heavily once it can explain, for example,
Object/Relational/XML mapping at a high level of
abstraction in a comprehensible and falsifiable manner.
More generally, megamodeling must help with managing diversity and heterogeneity of software technologies.
© 2012, 101companies
The upper frame uses the MegaL/yEd visual notation for megamodeling.
The lower frame shows some linked artifacts explained later in the paper.
Fig. 1. The linguistic architecture of a software product when displayed with the Me-gaL/Explorer tool.
technology for Object/XML mapping are clearly identifiable. Consider, for ex-
ample, the fact that the class generator is not described as generating ‘arbitrary’
C#. Instead, a designated subset, CSharpFromXsd, is used because the genera-
tor indeed produces very regular code whose regularity helps with understanding
Object/XML mapping, as we discuss later.
Demo
© 2012, 101companies
Dependencies of implementation
© 2012, 101companies
MegaL/yEd
© 2012, 101companies
© 2012, 101companies
© 2012, 101companies
© 2012, 101companies
© 2012, 101companies
© 2012, 101companies
Cont’d
© 2012, 101companies
© 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
© 2012, 101companies
A megamodel for Object/XML mapping
http://black42.uni-koblenz.de/production/101worker/MegaModels/capabilities/Object_XML_mapping/MegaL/
© 2012, 101companies
Conclusion
• 101companies helps technological space travelers.
• Megamodels model linguistic architecture.
• Finally, we understand Object/XML mapping.
• There is going to be a related summer school in Koblenz:
SoTeSoLa -- Software Technologies and Software Languages
Thanks!Questions?