SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
BACKGROUND                            XMF                         XM ODELER




                    XMF and XModeler

                               Tony Clark1

             1 School   of Engineering and Information Sciences
                            University of Middlesex


                             August 6, 2011
BACKGROUND                       XMF   XM ODELER




                             Outline
     Background
        History
        Technologies

     XMF
       Executable (Meta-)Modelling
       Language Engineering
       Code Templates
       Daemons

     XModeler
       Tool Models
       A Snapshot Tool
       Conclusion
BACKGROUND                             XMF                        XM ODELER




                              OMG, UML 2.0


        • Around 1999 Clark, Evans, Kent started attending OMG.
        • UML 2.0 started around this time.
        • The 2U Submission: UML as family of languages:
            • Templates.
            • Package Extension.
        • Tools and methods emerged for model-based language
             engineering:
               • Language Architectures.
               • Denotational Semantics.
               • Operational Semantics.
BACKGROUND                          XMF               XM ODELER




                   Modelling and Programming



        • Aim: to merge modelling and programming.
        • Tools: MMT, XMT, XMF.
        • Programming language based on FP and OCL.
        • Important features: meta-; reflection; OO.
        • Tools for Language Engineering.
BACKGROUND                          XMF                    XM ODELER




                                Xactium




        • Clark, Evans set up in 2003.
        • Developed XModeler (XMF-Mosaic) on top of XMF.
        • 2003-2008.
        • Clients: BAES; BT; Citi-Group; Artisan; BSkyB.
BACKGROUND                           XMF                             XM ODELER




                                  XMF
        • Meta-Circular Language (like MOF and ECore).
        • XCore Based on ObjvLisp.
        • File based or world-state.
        • Features for:
             • Packages of models/programs.
             • Higher-order operations.
             • OCL.
             • Meta-Object Prototcol (MOP).
             • Language Engineering (grammars, syntax processing).
             • Daemons (object listeners).
             • Pattern matching.
             • Code generation templates.
             • Threads.
             • XML processing (parsing).
             • Java integration.
BACKGROUND                              XMF                          XM ODELER




                                  XModeler

        • Eclipse RCP Tool.
        • Layered on (and written in) XMF.
        • MVC Architecture.
        • File interface for building XMF applications.
        • Functional interface e.g. deploy XML, check constraints.
        • Clients are all extensible:
                Client:   XMF Command Listener.
                Client:   Browsing all data.
                Client:   Editing all data.
                Client:   Diagrams: class; snapshot.
                Client:   Text editing, HTML browsing.
BACKGROUND        XMF        XM ODELER




             Meta-language
BACKGROUND                      XMF                XM ODELER




                             Models
     parserImport XOCL;

     context Root
       @Package BasicLibrary
         @Class Library
           @Attribute books   : Set(Book)    end
           @Attribute readers : Set(Reader) end
           @Attribute borrows : Set(Borrows) end
         end
         @Class Book
           @Attribute title : String end
         end
         @Class Reader
           @Attribute name : String end
         end
         @Class Borrows
           @Attribute reader : Reader end
           @Attribute book : Book end
         end
       end
BACKGROUND      XMF      XM ODELER




             Behaviour
BACKGROUND                                    XMF     XM ODELER




                                 Programs: XOCL

     parserImport XOCL;
     import BasicLibrary;

     context Book
       @Constructor(title) end

     context Library
       @Operation addBook(title:String)
         let b = Book(title)
         in self.books := books->including(b); b
         end
       end

     context Library
       @Operation findBook(title:String):Book
         let B = books->select(b | b.title = title)
         in if B->isEmpty
             then null
             else B->asSeq->head
             end
         end
       end
BACKGROUND                       XMF                      XM ODELER




                            Snapshots
     context Root
       @Operation test()
         let S = Snapshot("library",Seq{BasicLibrary})
         in S.add("l",Library());
             let l = S::l
             in S.add("b",l.addBook("War and Peace"));
                S.add("r",l.addReader("Fred"));
                S.add("b_x_r",l.addBorrows(S::r,S::b));
                S
             end
         end
       end
BACKGROUND                      XMF                          XM ODELER




                    Defining Constraints (1)


     context Library
       @Constraint all_borrowed_books_belong_to_library
         borrows.book->forAll(b | books->includes(b))
         fail "can only borrow books in library"
       end

     context Library
       @Constraint all_borrowing_readers_belong_to_library
         borrows.reader->forAll(r | readers->includes(r))
         fail "only registered readers can borrow books"
       end
BACKGROUND                                    XMF                                        XM ODELER




                            Defining Constraints (2)


     context Library
       @Constraint cannot_borrow_same_book_twice
         borrows->forAll(b1 | borrows->forAll(b2 | b1 <> b2 implies b1.book <> b2.book))
         fail "cannot borrow the same book twice"
       end

     context Library
       @Constraint all_books_have_unique_titles
         books->forAll(b1 | books->forAll(b2 | b1 <> b2 implies b1.title <> b2.title))
         fail "books should have unique titles"
       end

     context Library
       @Constraint all_readers_have_unique_names
         readers->forAll(r1 | readers->forAll(r2 | r1 <> r2 implies r1.name <> r2.name))
         fail "readers should have unique names"
       end
BACKGROUND                      XMF                        XM ODELER




                     Checking Constraints
     context Root
       @Operation test_illegal()
         let S = Snapshot("library",Seq{BasicLibrary});
               b = Book("War and Peace")
         in S.add("l",Library());
             S.add("r",(S::l).addReader("Fred"));
             S.add("b_x_r",(S::l).addBorrows(S::r,b));
             S
         end
       end

     [1] XMF> test_illegal().checkConstraints().failures();
     Seq{ConstraintReport(<Library d9ff5f>,
          <Constraint all_borrowed_books_belong_to_library>,
          false, can only borrow books in library)}
     [1] XMF>
BACKGROUND         XMF        XM ODELER




             Syntax Classes
BACKGROUND                                                  XMF                                                   XM ODELER




                                               Quasi-Quotes
     context Root
       @Operation add1_exp(exp:Performable):Performable
         [| 1 + <exp> |]
       end

     context Root
       @Operation seq_exp(exps:Seq(Performable)):Performable
         exps->iterate(e x = [| Seq{} |] |
           [| <x>->including(<e>) |])
       end

     [ 1 ] XMF> add1_exp ( [ | x + y | ] ) ;
     BinExp ( IntExp ( 1 ) , + , BinExp ( Var ( x ) , + , Var ( y ) ) )
     [ 1 ] XMF> seq_exp ( Seq { [ | 1 | ] , [ | x | ] , t r u e . l i f t ( ) } ) ;
     CollExp ( CollExp ( CollExp ( SetExp ( Seq , Seq { } ) , including , Seq{ IntExp ( 1 ) } ) , including , Seq{ Var
             ( x ) } ) , including , Seq{ BoolExp ( t r u e ) } )
     [ 1 ] XMF> seq_exp ( Seq { [ | 1 | ] , [ | x | ] , t r u e . l i f t ( ) } ) . p p r i n t ( ) ;
     Seq{}−> including ( 1 )−>including ( x )−>including ( t r u e )
     [ 1 ] XMF>
BACKGROUND                                                        XMF       XM ODELER




                                                       Grammars
     parserImport Parser::BNF;
     parserImport XOCL;

     Root::g :=
       @Grammar
         Start ::= i=Int o=Op j=Int {
            @Case o of
              "+" do i + j end
              "*" do i * j end
            end
         }.
         Op ::= ’+’ { "+" } | ’*’ { "*" }.
       end;

     [ 1 ] XMF> g . parseString ( " 1 + 2 " , " S t a r t " , Seq { } ) ;
     3
     [ 1 ] XMF>
BACKGROUND                                     XMF       XM ODELER




                Embedded Language Features (Usage)
     context Library
       @Subset all_borrowed_books_belong_to_library
         borrows.book books
       end

     context Library
       @Subset all_borrowing_readers_belong_to_library
         borrows.reader readers
       end

     context Library
       @Unique cannot_borrow_same_book_twice
         borrows book
       end

     context Library
       @Unique all_books_have_unique_titles
         books title
       end

     context Library
       @Unique all_readers_have_unique_names
         readers name
       end
BACKGROUND                       XMF                        XM ODELER




             Embedded Language Features (Def 1)

     parserImport XOCL;
     parserImport Parser::BNF;

     context Root
      @Class Unique
       @Grammar
        Unique ::= name=Name collection=Name field=Name {
          [| @Constraint unique self.<collection>->forAll(x |
               self.<collection>->forAll (y |
                 x <> y implies x.<field> <> y.<field>))
             end.name := "UNIQUE:" + <name.lift()> |]
        }.
       end
      end
BACKGROUND                       XMF                           XM ODELER




             Embedded Language Features (Def 2)
     parserImport XOCL;
     parserImport Parser::BNF;
     import OCL;

     context Root
       @Class Subset
         @Grammar
           Subset ::= name=Name sub=Path super=Path {
              [| @Constraint contained <sub>->forAll(x |
                   <super>->includes(x))
                 end.name := "CONTAINED:" + <name.lift()> |]
           }.
           Path ::= root=Name fields=(’.’ Name)* {
              fields->iterate(field exp = Var(root) |
                [| <exp>.<field> |])
           }.
         end
       end
BACKGROUND                       XMF                          XM ODELER




                        Generating Code

     context Library
       @Operation borrowsTable()
         let sout = StringOutputChannel()
         in @HTML(sout,0)
               <TABLE border=1>
                 { @Loop borrow in borrows do
                     [ <TR>
                          <TD> { borrow.reader.name } </TD>
                          <TD> { borrow.book.title } </TD>
                        </TR> ]
                    e_nd }
               </TABLE>
             end;
             sout.getString()
         end
       end
BACKGROUND            XMF           XM ODELER




             Tooling Requirements
BACKGROUND                        XMF    XM ODELER




                        Adding Daemons




     o.addDaemon(
       @Operation(slot,new,old)
         ... something to do...
       end)
BACKGROUND     XMF     XM ODELER




             Clients
BACKGROUND    XMF   XM ODELER




             HTML
BACKGROUND                            XMF             XM ODELER




                           Tool Requirements



        • Take any snapshot.
        • Interactively construct class instances.
        • Interactively edit class instances.
        • Check constraints after each modification.
        • Generate Java code for the snapshot.
BACKGROUND       XMF       XM ODELER




             Tool Models
BACKGROUND       XMF     XM ODELER




             MVC Model
BACKGROUND    XMF   XM ODELER




             Demo
BACKGROUND                         XMF                        XM ODELER




               Availability, Documentation, Research
             http://www.eis.mdx.ac.uk/staffpages/tonyclark/




                                  XPL

Más contenido relacionado

La actualidad más candente

Introduction to Groovy (Serbian Developer Conference 2013)
Introduction to Groovy (Serbian Developer Conference 2013)Introduction to Groovy (Serbian Developer Conference 2013)
Introduction to Groovy (Serbian Developer Conference 2013)Joachim Baumann
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
Solr Query Parsing
Solr Query ParsingSolr Query Parsing
Solr Query ParsingErik Hatcher
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of ScalaMartin Odersky
 
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleMartin Odersky
 
Compilers Are Databases
Compilers Are DatabasesCompilers Are Databases
Compilers Are DatabasesMartin Odersky
 
Java class 6
Java class 6Java class 6
Java class 6Edureka!
 
Java class 3
Java class 3Java class 3
Java class 3Edureka!
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論scalaconfjp
 
Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In PracticeMichiel Borkent
 
Java class 4
Java class 4Java class 4
Java class 4Edureka!
 
Lecture 13, 14 & 15 c# cmd let programming and scripting
Lecture 13, 14 & 15   c# cmd let programming and scriptingLecture 13, 14 & 15   c# cmd let programming and scripting
Lecture 13, 14 & 15 c# cmd let programming and scriptingWiliam Ferraciolli
 

La actualidad más candente (17)

Introduction to Groovy (Serbian Developer Conference 2013)
Introduction to Groovy (Serbian Developer Conference 2013)Introduction to Groovy (Serbian Developer Conference 2013)
Introduction to Groovy (Serbian Developer Conference 2013)
 
Scala: A brief tutorial
Scala: A brief tutorialScala: A brief tutorial
Scala: A brief tutorial
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
Solr Query Parsing
Solr Query ParsingSolr Query Parsing
Solr Query Parsing
 
ECMAScript 2015
ECMAScript 2015ECMAScript 2015
ECMAScript 2015
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
 
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simple
 
Compilers Are Databases
Compilers Are DatabasesCompilers Are Databases
Compilers Are Databases
 
Java class 6
Java class 6Java class 6
Java class 6
 
Scala Intro
Scala IntroScala Intro
Scala Intro
 
Java class 3
Java class 3Java class 3
Java class 3
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論
 
Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In Practice
 
Java class 4
Java class 4Java class 4
Java class 4
 
Lecture 13, 14 & 15 c# cmd let programming and scripting
Lecture 13, 14 & 15   c# cmd let programming and scriptingLecture 13, 14 & 15   c# cmd let programming and scripting
Lecture 13, 14 & 15 c# cmd let programming and scripting
 
Quick introduction to scala
Quick introduction to scalaQuick introduction to scala
Quick introduction to scala
 

Destacado

Dsl overview
Dsl overviewDsl overview
Dsl overviewClarkTony
 
Patterns 200711
Patterns 200711Patterns 200711
Patterns 200711ClarkTony
 
Filmstrip testing
Filmstrip testingFilmstrip testing
Filmstrip testingClarkTony
 
Dsl tutorial
Dsl tutorialDsl tutorial
Dsl tutorialClarkTony
 
Leap isec 2011
Leap isec 2011Leap isec 2011
Leap isec 2011ClarkTony
 
Kiss at oopsla 09
Kiss at oopsla 09Kiss at oopsla 09
Kiss at oopsla 09ClarkTony
 
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...ClarkTony
 

Destacado (9)

Dsl overview
Dsl overviewDsl overview
Dsl overview
 
Patterns 200711
Patterns 200711Patterns 200711
Patterns 200711
 
Filmstrip testing
Filmstrip testingFilmstrip testing
Filmstrip testing
 
Dsl tutorial
Dsl tutorialDsl tutorial
Dsl tutorial
 
Hcse pres
Hcse presHcse pres
Hcse pres
 
Ast 09
Ast 09Ast 09
Ast 09
 
Leap isec 2011
Leap isec 2011Leap isec 2011
Leap isec 2011
 
Kiss at oopsla 09
Kiss at oopsla 09Kiss at oopsla 09
Kiss at oopsla 09
 
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
Context-Aware Content-Centric Collaborative Workflow Management for Mobile De...
 

Similar a Kings 120711

Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Winl xf
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with ClojureJohn Stevenson
 
Introduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyIntroduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyRobert Viseur
 
Лев Валкин — Программируем функционально
Лев Валкин — Программируем функциональноЛев Валкин — Программируем функционально
Лев Валкин — Программируем функциональноDaria Oreshkina
 
Diving into Functional Programming
Diving into Functional ProgrammingDiving into Functional Programming
Diving into Functional ProgrammingLev Walkin
 
Clojure talk at Münster JUG
Clojure talk at Münster JUGClojure talk at Münster JUG
Clojure talk at Münster JUGAlex Ott
 
Tools for reading papers
Tools for reading papersTools for reading papers
Tools for reading papersJack Fox
 
Intro to Open Babel
Intro to Open BabelIntro to Open Babel
Intro to Open Babelbaoilleach
 
XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...
XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...
XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...BookNet Canada
 
Metaprogramming in julia
Metaprogramming in juliaMetaprogramming in julia
Metaprogramming in julia岳華 杜
 
Making Your Own Domain Specific Language
Making Your Own Domain Specific LanguageMaking Your Own Domain Specific Language
Making Your Own Domain Specific LanguageAncestry.com
 
Programming in Computational Biology
Programming in Computational BiologyProgramming in Computational Biology
Programming in Computational BiologyAtreyiB
 
A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...
A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...
A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...Franck Michel
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1Marco Gralike
 
S1 DML Syntax and Invocation
S1 DML Syntax and InvocationS1 DML Syntax and Invocation
S1 DML Syntax and InvocationArvind Surve
 
DML Syntax and Invocation process
DML Syntax and Invocation processDML Syntax and Invocation process
DML Syntax and Invocation processArvind Surve
 

Similar a Kings 120711 (20)

Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Win
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
Introduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyIntroduction to libre « fulltext » technology
Introduction to libre « fulltext » technology
 
Clojure intro
Clojure introClojure intro
Clojure intro
 
Лев Валкин — Программируем функционально
Лев Валкин — Программируем функциональноЛев Валкин — Программируем функционально
Лев Валкин — Программируем функционально
 
Diving into Functional Programming
Diving into Functional ProgrammingDiving into Functional Programming
Diving into Functional Programming
 
Clojure talk at Münster JUG
Clojure talk at Münster JUGClojure talk at Münster JUG
Clojure talk at Münster JUG
 
Tools for reading papers
Tools for reading papersTools for reading papers
Tools for reading papers
 
Elixir
ElixirElixir
Elixir
 
Intro to Open Babel
Intro to Open BabelIntro to Open Babel
Intro to Open Babel
 
XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...
XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...
XSLT 3 for EPUB and Print - Liam R.E. Quin (Barefoot Computing) - ebookcraft ...
 
Metaprogramming in julia
Metaprogramming in juliaMetaprogramming in julia
Metaprogramming in julia
 
Making Your Own Domain Specific Language
Making Your Own Domain Specific LanguageMaking Your Own Domain Specific Language
Making Your Own Domain Specific Language
 
Elixir introd
Elixir introdElixir introd
Elixir introd
 
Logic Programming and ILP
Logic Programming and ILPLogic Programming and ILP
Logic Programming and ILP
 
Programming in Computational Biology
Programming in Computational BiologyProgramming in Computational Biology
Programming in Computational Biology
 
A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...
A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...
A Generic Mapping-based Query Translation from SPARQL to Various Target Datab...
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
S1 DML Syntax and Invocation
S1 DML Syntax and InvocationS1 DML Syntax and Invocation
S1 DML Syntax and Invocation
 
DML Syntax and Invocation process
DML Syntax and Invocation processDML Syntax and Invocation process
DML Syntax and Invocation process
 

Más de ClarkTony

The Uncertain Enterprise
The Uncertain EnterpriseThe Uncertain Enterprise
The Uncertain EnterpriseClarkTony
 
Actors for Behavioural Simulation
Actors for Behavioural SimulationActors for Behavioural Simulation
Actors for Behavioural SimulationClarkTony
 
LEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and AnalysisLEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and AnalysisClarkTony
 
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven ArchitectureA Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven ArchitectureClarkTony
 
Context Aware Reactive Applications
Context Aware Reactive ApplicationsContext Aware Reactive Applications
Context Aware Reactive ApplicationsClarkTony
 
Model Slicing
Model SlicingModel Slicing
Model SlicingClarkTony
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testingClarkTony
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testingClarkTony
 
Mcms and ids sig
Mcms and ids sigMcms and ids sig
Mcms and ids sigClarkTony
 
Reverse engineering and theory building v3
Reverse engineering and theory building v3Reverse engineering and theory building v3
Reverse engineering and theory building v3ClarkTony
 
Onward presentation.en
Onward presentation.enOnward presentation.en
Onward presentation.enClarkTony
 
Formalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsFormalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsClarkTony
 
Dsm as theory building
Dsm as theory buildingDsm as theory building
Dsm as theory buildingClarkTony
 
Code gen 09 kiss results
Code gen 09   kiss resultsCode gen 09   kiss results
Code gen 09 kiss resultsClarkTony
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testingClarkTony
 

Más de ClarkTony (19)

The Uncertain Enterprise
The Uncertain EnterpriseThe Uncertain Enterprise
The Uncertain Enterprise
 
Actors for Behavioural Simulation
Actors for Behavioural SimulationActors for Behavioural Simulation
Actors for Behavioural Simulation
 
LEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and AnalysisLEAP A Language for Architecture Design, Simulation and Analysis
LEAP A Language for Architecture Design, Simulation and Analysis
 
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven ArchitectureA Common Basis for Modelling Service-Oriented and Event-Driven Architecture
A Common Basis for Modelling Service-Oriented and Event-Driven Architecture
 
Context Aware Reactive Applications
Context Aware Reactive ApplicationsContext Aware Reactive Applications
Context Aware Reactive Applications
 
Model Slicing
Model SlicingModel Slicing
Model Slicing
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testing
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testing
 
Mcms and ids sig
Mcms and ids sigMcms and ids sig
Mcms and ids sig
 
Ocl 09
Ocl 09Ocl 09
Ocl 09
 
Scam 08
Scam 08Scam 08
Scam 08
 
Reverse engineering and theory building v3
Reverse engineering and theory building v3Reverse engineering and theory building v3
Reverse engineering and theory building v3
 
Onward presentation.en
Onward presentation.enOnward presentation.en
Onward presentation.en
 
Formalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsFormalizing homogeneous language embeddings
Formalizing homogeneous language embeddings
 
Dsm as theory building
Dsm as theory buildingDsm as theory building
Dsm as theory building
 
Code gen 09 kiss results
Code gen 09   kiss resultsCode gen 09   kiss results
Code gen 09 kiss results
 
Cg 2011
Cg 2011Cg 2011
Cg 2011
 
Iswim for testing
Iswim for testingIswim for testing
Iswim for testing
 
UML01
UML01UML01
UML01
 

Último

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Kings 120711

  • 1. BACKGROUND XMF XM ODELER XMF and XModeler Tony Clark1 1 School of Engineering and Information Sciences University of Middlesex August 6, 2011
  • 2. BACKGROUND XMF XM ODELER Outline Background History Technologies XMF Executable (Meta-)Modelling Language Engineering Code Templates Daemons XModeler Tool Models A Snapshot Tool Conclusion
  • 3. BACKGROUND XMF XM ODELER OMG, UML 2.0 • Around 1999 Clark, Evans, Kent started attending OMG. • UML 2.0 started around this time. • The 2U Submission: UML as family of languages: • Templates. • Package Extension. • Tools and methods emerged for model-based language engineering: • Language Architectures. • Denotational Semantics. • Operational Semantics.
  • 4. BACKGROUND XMF XM ODELER Modelling and Programming • Aim: to merge modelling and programming. • Tools: MMT, XMT, XMF. • Programming language based on FP and OCL. • Important features: meta-; reflection; OO. • Tools for Language Engineering.
  • 5. BACKGROUND XMF XM ODELER Xactium • Clark, Evans set up in 2003. • Developed XModeler (XMF-Mosaic) on top of XMF. • 2003-2008. • Clients: BAES; BT; Citi-Group; Artisan; BSkyB.
  • 6. BACKGROUND XMF XM ODELER XMF • Meta-Circular Language (like MOF and ECore). • XCore Based on ObjvLisp. • File based or world-state. • Features for: • Packages of models/programs. • Higher-order operations. • OCL. • Meta-Object Prototcol (MOP). • Language Engineering (grammars, syntax processing). • Daemons (object listeners). • Pattern matching. • Code generation templates. • Threads. • XML processing (parsing). • Java integration.
  • 7. BACKGROUND XMF XM ODELER XModeler • Eclipse RCP Tool. • Layered on (and written in) XMF. • MVC Architecture. • File interface for building XMF applications. • Functional interface e.g. deploy XML, check constraints. • Clients are all extensible: Client: XMF Command Listener. Client: Browsing all data. Client: Editing all data. Client: Diagrams: class; snapshot. Client: Text editing, HTML browsing.
  • 8. BACKGROUND XMF XM ODELER Meta-language
  • 9. BACKGROUND XMF XM ODELER Models parserImport XOCL; context Root @Package BasicLibrary @Class Library @Attribute books : Set(Book) end @Attribute readers : Set(Reader) end @Attribute borrows : Set(Borrows) end end @Class Book @Attribute title : String end end @Class Reader @Attribute name : String end end @Class Borrows @Attribute reader : Reader end @Attribute book : Book end end end
  • 10. BACKGROUND XMF XM ODELER Behaviour
  • 11. BACKGROUND XMF XM ODELER Programs: XOCL parserImport XOCL; import BasicLibrary; context Book @Constructor(title) end context Library @Operation addBook(title:String) let b = Book(title) in self.books := books->including(b); b end end context Library @Operation findBook(title:String):Book let B = books->select(b | b.title = title) in if B->isEmpty then null else B->asSeq->head end end end
  • 12. BACKGROUND XMF XM ODELER Snapshots context Root @Operation test() let S = Snapshot("library",Seq{BasicLibrary}) in S.add("l",Library()); let l = S::l in S.add("b",l.addBook("War and Peace")); S.add("r",l.addReader("Fred")); S.add("b_x_r",l.addBorrows(S::r,S::b)); S end end end
  • 13. BACKGROUND XMF XM ODELER Defining Constraints (1) context Library @Constraint all_borrowed_books_belong_to_library borrows.book->forAll(b | books->includes(b)) fail "can only borrow books in library" end context Library @Constraint all_borrowing_readers_belong_to_library borrows.reader->forAll(r | readers->includes(r)) fail "only registered readers can borrow books" end
  • 14. BACKGROUND XMF XM ODELER Defining Constraints (2) context Library @Constraint cannot_borrow_same_book_twice borrows->forAll(b1 | borrows->forAll(b2 | b1 <> b2 implies b1.book <> b2.book)) fail "cannot borrow the same book twice" end context Library @Constraint all_books_have_unique_titles books->forAll(b1 | books->forAll(b2 | b1 <> b2 implies b1.title <> b2.title)) fail "books should have unique titles" end context Library @Constraint all_readers_have_unique_names readers->forAll(r1 | readers->forAll(r2 | r1 <> r2 implies r1.name <> r2.name)) fail "readers should have unique names" end
  • 15. BACKGROUND XMF XM ODELER Checking Constraints context Root @Operation test_illegal() let S = Snapshot("library",Seq{BasicLibrary}); b = Book("War and Peace") in S.add("l",Library()); S.add("r",(S::l).addReader("Fred")); S.add("b_x_r",(S::l).addBorrows(S::r,b)); S end end [1] XMF> test_illegal().checkConstraints().failures(); Seq{ConstraintReport(<Library d9ff5f>, <Constraint all_borrowed_books_belong_to_library>, false, can only borrow books in library)} [1] XMF>
  • 16. BACKGROUND XMF XM ODELER Syntax Classes
  • 17. BACKGROUND XMF XM ODELER Quasi-Quotes context Root @Operation add1_exp(exp:Performable):Performable [| 1 + <exp> |] end context Root @Operation seq_exp(exps:Seq(Performable)):Performable exps->iterate(e x = [| Seq{} |] | [| <x>->including(<e>) |]) end [ 1 ] XMF> add1_exp ( [ | x + y | ] ) ; BinExp ( IntExp ( 1 ) , + , BinExp ( Var ( x ) , + , Var ( y ) ) ) [ 1 ] XMF> seq_exp ( Seq { [ | 1 | ] , [ | x | ] , t r u e . l i f t ( ) } ) ; CollExp ( CollExp ( CollExp ( SetExp ( Seq , Seq { } ) , including , Seq{ IntExp ( 1 ) } ) , including , Seq{ Var ( x ) } ) , including , Seq{ BoolExp ( t r u e ) } ) [ 1 ] XMF> seq_exp ( Seq { [ | 1 | ] , [ | x | ] , t r u e . l i f t ( ) } ) . p p r i n t ( ) ; Seq{}−> including ( 1 )−>including ( x )−>including ( t r u e ) [ 1 ] XMF>
  • 18. BACKGROUND XMF XM ODELER Grammars parserImport Parser::BNF; parserImport XOCL; Root::g := @Grammar Start ::= i=Int o=Op j=Int { @Case o of "+" do i + j end "*" do i * j end end }. Op ::= ’+’ { "+" } | ’*’ { "*" }. end; [ 1 ] XMF> g . parseString ( " 1 + 2 " , " S t a r t " , Seq { } ) ; 3 [ 1 ] XMF>
  • 19. BACKGROUND XMF XM ODELER Embedded Language Features (Usage) context Library @Subset all_borrowed_books_belong_to_library borrows.book books end context Library @Subset all_borrowing_readers_belong_to_library borrows.reader readers end context Library @Unique cannot_borrow_same_book_twice borrows book end context Library @Unique all_books_have_unique_titles books title end context Library @Unique all_readers_have_unique_names readers name end
  • 20. BACKGROUND XMF XM ODELER Embedded Language Features (Def 1) parserImport XOCL; parserImport Parser::BNF; context Root @Class Unique @Grammar Unique ::= name=Name collection=Name field=Name { [| @Constraint unique self.<collection>->forAll(x | self.<collection>->forAll (y | x <> y implies x.<field> <> y.<field>)) end.name := "UNIQUE:" + <name.lift()> |] }. end end
  • 21. BACKGROUND XMF XM ODELER Embedded Language Features (Def 2) parserImport XOCL; parserImport Parser::BNF; import OCL; context Root @Class Subset @Grammar Subset ::= name=Name sub=Path super=Path { [| @Constraint contained <sub>->forAll(x | <super>->includes(x)) end.name := "CONTAINED:" + <name.lift()> |] }. Path ::= root=Name fields=(’.’ Name)* { fields->iterate(field exp = Var(root) | [| <exp>.<field> |]) }. end end
  • 22. BACKGROUND XMF XM ODELER Generating Code context Library @Operation borrowsTable() let sout = StringOutputChannel() in @HTML(sout,0) <TABLE border=1> { @Loop borrow in borrows do [ <TR> <TD> { borrow.reader.name } </TD> <TD> { borrow.book.title } </TD> </TR> ] e_nd } </TABLE> end; sout.getString() end end
  • 23. BACKGROUND XMF XM ODELER Tooling Requirements
  • 24. BACKGROUND XMF XM ODELER Adding Daemons o.addDaemon( @Operation(slot,new,old) ... something to do... end)
  • 25. BACKGROUND XMF XM ODELER Clients
  • 26. BACKGROUND XMF XM ODELER HTML
  • 27. BACKGROUND XMF XM ODELER Tool Requirements • Take any snapshot. • Interactively construct class instances. • Interactively edit class instances. • Check constraints after each modification. • Generate Java code for the snapshot.
  • 28. BACKGROUND XMF XM ODELER Tool Models
  • 29. BACKGROUND XMF XM ODELER MVC Model
  • 30. BACKGROUND XMF XM ODELER Demo
  • 31. BACKGROUND XMF XM ODELER Availability, Documentation, Research http://www.eis.mdx.ac.uk/staffpages/tonyclark/ XPL