Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt.

Slides:



Advertisements
Similar presentations
A component- and message-based architectural style for GUI software
Advertisements

Presented by: Thabet Kacem Spring Outline Contributions Introduction Proposed Approach Related Work Reconception of ADLs XTEAM Tool Chain Discussion.
Automated Analysis and Code Generation for Domain-Specific Models George Edwards Center for Systems and Software Engineering University of Southern California.
ModelicaXML A Modelica XML representation with Applications Adrian Pop, Peter Fritzson Programming Environments Laboratory Linköping University.
Institute For Software Integrated Systems Vanderbilt University Applications of Model Integrated Computing to The Synchronous Language Signal Ethan Jackson.
An framework for model-driven product design and development using Modelica Adrian Pop, Olof Johansson, Peter Fritzson Programming Environments Laboratory.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Problem Spaces and Search Fall 2008 Jingsong.
Using the Vanderbilt Generic Modeling Environment (GME) to Address SOA QoS Sumant Tambe Graduate Intern, Applied Research, Telcordia Technologies Inc.
Whole Platform Tesi di Dottorato di: RICCARDO SOLMI Università degli Studi di Bologna Facoltà di scienze matematiche, fisiche e naturali Corso di Dottorato.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
UNIT-V The MVC architecture and Struts Framework.
Type-Directed, Whitespace-Delimited Parsing for Embedded DSLs Cyrus Omar School of Computer Science Carnegie Mellon University [GlobalDSL13] Benjamin ChungAlex.
Extensible Type-Driven Parsing for Embedded DSLs in Wyvern Cyrus Omar Benjamin Chung Darya Kurilova Ligia Nistor Alex Potanin (Victoria University of Wellington)
XML files (with LINQ). Introduction to LINQ ( Language Integrated Query ) C#’s new LINQ capabilities allow you to write query expressions that retrieve.
Spectra Software Defined Radio Products Applying Model Driven Design, Generative Programming, and Agile Software Techniques to the SDR Domain OOPSLA '05.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Design Patterns Introduction. What is a Design Pattern?  A technique to repeat designer success.  Borrowed from Civil and Electrical Engineering domains.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
Yu Sun 1, Zekai Demirezen 1, Marjan Mernik 2, Jeff Gray 1, Barret Bryant 1 1 Department of Computer and Information Sciences, University of Alabama at.
XML and its applications: 4. Processing XML using PHP.
Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt.
Introduction to MDA (Model Driven Architecture) CYT.
A REFACTORING TOOL FOR DESIGN PATTERNS WITH MODEL TRANSFORMATIONS Zekai Demirezen Yasemin Topaloğlu Ege University Department of Computer Engineering
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
I T & S A e r o s p a c eD e f e n c e THALES Research & Technology THALES recommendations for the final OMG standard on Query / Views / Transformations.
1 Example application: source code analysis 125 file types; 8029 files; 4689 non-Java; 1112 svn revisions.
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
Reviewing Recent ICSE Proceedings For:.  Defining and Continuous Checking of Structural Program Dependencies  Automatic Inference of Structural Changes.
Generative Middleware Specializations for Distributed, Real-time and Embedded Systems Institute for Software Integrated Systems Dept of EECS, Vanderbilt.
UDM An Infrastructure for Implementing Domain-Specific Modeling Languages Endre Magyari, Arpad Bakay, Andras Lang, Tamas Paka, Attila Vizhanyo, Aditya.
Model-Driven Engineering for Development-Time QoS Validation of Component-based Software Systems James Hill, Sumant Tambe & Aniruddha Gokhale Vanderbilt.
L10 - April 12, 2006copyright Thomas Pole , all rights reserved 1 Lecture 10: Software Assets and Text: Ch. 8: Language Anatomy and Ch 9: Families.
GPCE'04, Vancouver 1 Towards a General Template Introspection Library in C++ István Zólyomi, Zoltán Porkoláb Department of Programming Languages and Compilers.
Declaratively Producing Data Mash-ups Sudarshan Murthy 1, David Maier 2 1 Applied Research, Wipro Technologies 2 Department of Computer Science, Portland.
Automated Transformation of Statements Within Evolving Domain Specific Languages Peter Bell CEO/CTO, SystemsForge 7th OOPSLA Workshop on Domain-Specific.
Grid programming with components: an advanced COMPonent platform for an effective invisible grid © 2006 GridCOMP Grids Programming with components. An.
Using Meta-Model-Driven Views to Address Scalability in i* Models Jane You Department of Computer Science University of Toronto.
Sheet 1 DocEng’03, Grenoble, November 2003 Model Driven Architecture based XML Processing Ivan Kurtev, Klaas van den Berg University of Twente, the Netherlands.
Towards Multi-Paradigm Software Development Valentino Vranić Department of Computer Science and Engineering Faculty of Electrical Engineering.
Computer Science: A Structured Programming Approach Using C Graphs A graph is a collection of nodes, called vertices, and a collection of segments,
Sumant Tambe, et. al LEESA DSL / 21 LEESA: Embedding Strategic and XPath-like Object Structure Traversals in C++ Sumant Tambe Aniruddha Gokhale.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
User Profiling using Semantic Web Group members: Ashwin Somaiah Asha Stephen Charlie Sudharshan Reddy.
Component-based System Integration via (Meta)Model Composition
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
OOPSLA workshop on Domain-Specific Visual Languages 1 Juha-Pekka Tolvanen, Steven Kelly, Jeff Gray, Kalle Lyytinen.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Visualization Four groups Design pattern for information visualization
Java Software Solutions Lewis and Loftus Chapter 9 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Enhanced Class Design -- Introduction.
The Visitor Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
ANU comp2110 Software Design lecture 8 COMP2110 Software Design in 2004 lecture 8 Software Architecture 1 of 2 (design, lecture 3 of 6) Goal of this small.
Martin Kruliš by Martin Kruliš (v1.1)1.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Towards A QoS Modeling and Modularization Framework for Component-based Systems Sumant Tambe* Akshay Dabholkar Aniruddha Gokhale Amogh Kavimandan (Presenter)
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Fault-tolerance for Component-based Systems – An Automated Middleware Specialization Approach Sumant Tambe* Akshay Dabholkar Aniruddha Gokhale Abhishek.
Nigel Baker UWE & CERN/EP-CMA Design Patterns for Integrating Product and Process Models The C.R.I.S.T.A.L. Project ( C ooperative R epositories & I nformation.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
AUTOMATIC GENERATION OF MODEL TRAVERSALS FROM METAMODEL DEFINITIONS Authors: Tomaž Lukman, Marjan Mernik, Zekai Demirezen, Barrett Bryant, Jeff Gray ACM.
A Framework for Automated and Composable Testing of Component-based Services Miguel A. Jiménez, Ángela Villota, Norha M. Villegas, Gabriel Tamura, Laurence.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
George Edwards Computer Science Department Center for Systems and Software Engineering University of Southern California
Sumant Tambe* Akshay Dabholkar Aniruddha Gokhale
Introduction to Design Patterns
Behavioral Design Patterns
{ XML Technologies } BY: DR. M’HAMED MATAOUI
Requirements for better object-oriented design and programming languages Could be organized better.
Ivan Kurtev, Klaas van den Berg Software Engineering Group
Presentation transcript:

Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt University, Nashville, TN, USA *Contact : 2nd International Workshop on Domain-Specific Program Development (DSPD), GPCE 2008, Nashville, TN, USA

2 Sumant Tambe, et. al LEESA DSPD 2008 Object Structures and Operations  Object Structures  Hierarchical data structure (XML)  Object Graph/Network (e.g., Domain-specific Models)  Uses of object structures  Domain-specific modeling language (DSML) interpreters, transformations  Systems using XML data binding  Component deployment & configuration engines  Web services  Common operations  Queries (search)  Traversals (visit each element)

3 Sumant Tambe, et. al LEESA DSPD 2008 Existing Approaches of Accessing Object Structures S1 S2  Imperative object-oriented API  Implemented using classes, interfaces, and collections of objects in Java, C++  Visitor pattern: separates visitation actions from traversal (Good!)  Fancy C++ generic programming techniques using STL/Boost::bind  XQuery / XSLT / XPath  W3C standards  Suitable for hierarchical structures  Suitable for XML-to-XML transformation  Traversal/Visitor Language (TVL)  Separate specification language  Autogenerates traversal code  LINQ (Language Integrated Query)  Used in C# and VB  Based on Microsoft.NET framework TraversalVisitation Action class StateMachine { … }; class State { … }; class Transition { … };

4 Sumant Tambe, et. al LEESA DSPD 2008 Limitations of Existing Techniques  Imperative object-oriented API  Code bloat while using large/complex data models  Intent is lost in low level details  In classic visitor, “visit-all” semantics are inefficient in most cases (visits more elements than necessary)  In other visitor variants traversals are coupled with visitation actions – limits reusability  XQuery / XSLT / Xpath  Only hierarchical. No support for object graphs  Traversal/Visitor Language (TVL)  High cost of development of lexer/parser  Must learn new language (syntax, semantics) and code generator  LINQ  Depends on language extensions in C#, VB  Depends on.NET framework features Visitation Action Traversal &

5 Sumant Tambe, et. al LEESA DSPD 2008 Solution: LEESA  LEESA: Language for Embedded Query and Traversal  Features of LEESA  A domain-specific embedded language (DSEL) for writing queries and traversals over object graphs (models)  Provides short and expressive syntax for traversal  Supports multiple traversal strategies  Supports Visitor: decouples visitation actions from traversal  Cheap to develop because it is embedded in C++  Reuses C++ lexer, parser and whole slew of standard libraries  Much flatter learning curve than external DSLs  Seamless transition between LEESA and traditional C++  Interoperable with other popular C++ DSELs (e.g., Boost.Phoenix, Boost.Lambda)

6 Sumant Tambe, et. al LEESA DSPD 2008 Layered Architecture of LEESA DSL for query and traversal A C++ generative programming technique OO access API (UDM, XML data binding) In memory representation of object structure

7 Sumant Tambe, et. al LEESA DSPD 2008 Composition Navigation Using LEESA Example 1: Give all the States under RootFolder RootFolder() >> StateMachine() >> State() Example 2: Give all the Property atoms under RootFolder Returns a std::set RootFolder() >> StateMachine() >> State() >> Property() Returns a std::set Example 3: Give the parent State of Property P P << State() Returns a std::set of size = 1 Parent/child composition relationship navigation using “>>” and “<<”

8 Sumant Tambe, et. al LEESA DSPD 2008 Object Structure Queries Using LEESA Example 4: Give all the States under RootFolder whose name starts with “XYZ” RootFolder() >> StateMachine() >> State() >> SelectByName(State(),”XYZ.*”) Example 5: Same as above + apply arbitrary filter + sort RootFolder() >> StateMachine() >> State() >> SelectByName(State(),”XYZ.*”) >> Property() >> Select(Property(), predicate) >> Sort(Property(), comparator) Many query operators are supported such as Unique, Sort, SelectByName, Select (generic) Where predicate and comparator are standard C++ functions or stateful function objects

9 Sumant Tambe, et. al LEESA DSPD 2008 Association Navigation Using LEESA Association ends can be navigated to using “>>&” followed by the name of the association. Example 6: Give all the States that are at the “dst” end of transitions RootFolder() >> StateMachine() >> Transition() >>& Transition::dstTransition Returns a std::set = { S2, S3, S4 }

10 Sumant Tambe, et. al LEESA DSPD 2008  Visitor pattern is supported  Add visitor object after “>>”  Calls corresponding Visit function  Separates visitation actions from traversal order Object Structure Visitation Using LEESA CountVisitor cv; RootFolder() >> StateMachine() >> cv >> State() >> cv >> Property() >> cv  “>>” visits in breadth-first order  “>>=” visits in depth-first order  Query operators work with both strategies  Traversal strategies can be mixed together RootFolder() >>= StateMachine() >> cv >>= State() >> cv >>= Property() >> cv Example 7: Visit each StateMachine, State, and Property and count them Example 8: Same as before but in depth-first order

11 Sumant Tambe, et. al LEESA DSPD 2008 Combining LEESA Traversal Strategies #define DEPTH_FIRST >>= CountVisitor pv; RootFolder() DEPTH_FIRST StateMachine() >> cv >> State() >> Property() >> Sort(Property(),comparator) >> cv Example 9: Visit all StateMachines in depth-first order and visit all the properties in sorted order

12 Sumant Tambe, et. al LEESA DSPD 2008 Layered Architecture of LEESA DSL for query and traversal A C++ generative programming technique OO access API (UDM, XML data binding) In memory representation of object structure

13 Sumant Tambe, et. al LEESA DSPD 2008 LEESA’s Generic Data Access Layer class RootFolder { set StateMachine_kind_children(); template set children (); }; class StateMachine { set State_kind_children(); set Transition_kind_children(); template set children (); }; class State { set Property_kind_children(); template set children (); }; class Transition { State srcTransition(); State dstTransition(); }; class Property; Automatically generated UDM C++ interface from meta-model: T determines children kind

14 Sumant Tambe, et. al LEESA DSPD 2008 Layered Architecture of LEESA DSL for query and traversal A C++ generative programming technique OO access API (UDM, XML data binding) In memory representation of object structure

15 Sumant Tambe, et. al LEESA DSPD 2008 Overview of Expression Templates  First developed in 1994 by Todd Veldhuizen  Known uses: Boost.Spirit parser, Blitz++ scientific computing library  Based on the idea of lazy evaluation  Execute expressions much later in the program from the point of their definition  Pass an expression -- not the result of the expression -- as a parameter to a function  E.g., foo (x * y + z);  The result of expression is computed before calling the function  Instead, an abstract syntax tree (AST) is created at compile-time using templates and operator overloading XY Z + *

16 Sumant Tambe, et. al LEESA DSPD 2008 Returns a set of R LEESA’s Expression Templates  LEESA defines a couple of expression templates and many operators  We’ll consider GetChildren operator  ChainExpr expression template  ChainExpr creates an AST that embodies traversal GetChildren  L.children (); RootFolder() >> StateMachine() >> State() >> Property() GetChildren  StateMachine.children ();

17 Sumant Tambe, et. al LEESA DSPD 2008 Future Work & Concluding Remarks  How to improve error reporting?  Promising solution: C++ concept checking  How to make it less dependent on structure?  Structure-shyness property  How to support wildcards? RootFolder() >> ***** >> Property()