Code Generation in CDE Remi Lequette ILOG.

Slides:



Advertisements
Similar presentations
2006 Pearson Education, Inc. All rights reserved Object-Oriented Programming: Inheritance.
Advertisements

1 Packages: Putting Classes Together. 2 Introduction The main feature of OOP is its ability to support the reuse of code: Extending the classes (via inheritance)
Design Patterns.
Chapter 1: The Database Environment
Chapter 7 System Models.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Chapter 11 Separate Compilation and Namespaces. Copyright © 2006 Pearson Addison-Wesley. All rights reserved Learning Objectives Separate Compilation.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Introduction to Rails.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Copyright © 2002 Pearson Education, Inc. Slide 1.
Copyright © 2003 Pearson Education, Inc. Slide 1.
Chapter 11 Introduction to Programming in C
Introduction to Product Family Engineering. 11 Oct 2002 Ver 2.0 ©Copyright 2002 Vortex System Concepts 2 Product Family Engineering Overview Project Engineering.
Credit hours: 4 Contact hours: 50 (30 Theory, 20 Lab) Prerequisite: TB143 Introduction to Personal Computers.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
3 Copyright © 2005, Oracle. All rights reserved. Basic Java Syntax and Coding Conventions.
8 Copyright © 2005, Oracle. All rights reserved. Object Life Cycle and Inner Classes.
11 Copyright © 2005, Oracle. All rights reserved. Using Arrays and Collections.
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
7 Copyright © 2005, Oracle. All rights reserved. Creating Classes and Objects.
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Determine Eligibility Chapter 4. Determine Eligibility 4-2 Objectives Search for Customer on database Enter application signed date and eligibility determination.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Modern Systems Analyst and as a Project Manager
1 9 Moving to Design Lecture Analysis Objectives to Design Objectives Figure 9-2.
Bringing Procedural Knowledge to XLIFF Prof. Dr. Klemens Waldhör TAUS Labs & FOM University of Applied Science FEISGILTT 16 October 2012 Seattle, USA.
Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
Week 2 The Object-Oriented Approach to Requirements
Configuration management
11 Contracts CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 6)
1 Linked Lists III Template Chapter 3. 2 Objectives You will be able to: Write a generic list class as a C++ template. Use the template in a test program.
ABC Technology Project
Access Lesson 13 Programming in Access Microsoft Office 2010 Advanced Cable / Morrison 1.
INTRODUCTION TO SIMULATION WITH OMNET++ José Daniel García Sánchez ARCOS Group – University Carlos III of Madrid.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
HORIZONT TWS/WebAdmin TWS/WebAdmin for Distributed
4 Oracle Data Integrator First Project – Simple Transformations: One source, one target 3-1.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software processes 2.
Executional Architecture
Implementation Architecture
Introducing JavaScript
Presented by Douglas Greer Creating and Maintaining Business Objects Universes.
Enhancing Spotfire with the Power of R
Requirements Analysis 1. 1 Introduction b501.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis Introduction.
25 seconds left…...
Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Chapter 10: The Traditional Approach to Design
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 11 Describing Process Specifications and Structured Decisions
Chapter 13 The Data Warehouse
14-1 © Prentice Hall, 2004 Chapter 14: OOSAD Implementation and Operation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh.
Abstract Class, Packages and interface from Chapter 9
1 Abstract Class and Packages from Chapter 9 Lecture.
Modeling Main issues: What do we want to build How do we write this down.
From Model-based to Model-driven Design of User Interfaces.
Chapter 9: Using Classes and Objects. Understanding Class Concepts Types of classes – Classes that are only application programs with a Main() method.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Passing from design to implementation
Lecture 22 Inheritance Richard Gesick.
SPL – PS1 Introduction to C++.
Presentation transcript:

Code Generation in CDE Remi Lequette ILOG

Overview Introduction CDE architecture Generation technique Conclusion ILOG & VCM CDE CDE architecture Cartridge structure Generated artifacts Generation technique The OPML language The UML model The generators Conclusion

ILOG Provides Software Components VCM Division C++ and Java class libraries Graphics, Rules Optimization: Linear, Constraints, Scheduling, Dispatching. Telecom, Transportation & Finance, VCM Provides consulting VCM Division Value Chain Management (production & distribution planning) ISV customers (SAP, Oracle, …) ERP - SCM End User customers (in house development)

CDE - Cartridge Development Env. Target is ERP - SCM users They have data and an execution system They have an optimization problem Generic solution is not applicable They buy a solution from ILOG consulting Consulting firm Third party reusable solution CDE provides cartridges Reusable architecture Code, projects, documentation generation Data access (files, RDBMS, ERP system) Increase productivity by focus on optimization code

CDE Cartridge Provides a standard architecture Application Server Cartridge Algorithm Control GUI Data Model Provides a standard architecture Provides a flexible integration framework Provides a toolbox for development Architecture

Detailed Architecture high level entry points GUI, console, batch Commands Internal Mapping Data Model Algorithm Control Transformation External optimization algorithm interface to external data sources Architecture internal object-oriented model internal relational model mapping

Typical Data Flow Control 2. mapping & check 3. data transformation & check 1. data loading Commands Internal Mapping Data Model Algorithm Control Transformation External 7. solution saving 4. optimization Architecture 5. solution transformation & check 6. mapping & check

Cartridge Generation Control customizable module Commands External Mapping Algorithm Transformation Data Model Internal Mapping CDE/ILOG libraries CDE code generation Structure Commands Model Tables ECPI CDE specification Integrator Developer Architecture Integrator

Generated Artifacts Code Documentation GUI Directories Data model in C++ Script access to the data model Relational mapping Documentation Classes, tables, commands GUI Code and panels for testing the cartridge Directories Project organization, test structure Compilation projects For Microsoft Visual Studio

Generation Technology OPML specification Templates CDE Generator Data Access Model Implementation HTML documentation Scripting Interface CDE Libraries Algorithm Cartridge ILOG optimization Libraries Architecture

Cartridge Specification Language Object Property Modeling Language (OPML) Based on UML concepts: classes, components, stereotypes... Textual language Specification of cartridge organization, data model (C++, script), mappings, commands… Advanced property management: Properties can be attached to model elements Property tool Declares available properties for a tool: cpp, script, documentation... Property definition = name, types, default values, related elements... Property instance holds property values for a given model OPML

Project Top level namespace Contains categories and subsystems // This is an internal comment #include <ilcde/case/opml/opml.pty> #include <ilcde/datacon/ecpi/RelationalSchema.pty> #include <ilcde/datacon/ecpi/dbm.pty> project christmas { cpp : Cpp; // C++ generation jscript : JScript; // scripting category classes {…} subsystem components {…} } include of other OPML files declares property instances contains categories and subsystems Top level namespace Contains categories and subsystems OPML

Categories and Classes project christmas { ... category christmas { cpp.generate = yes; visibility= private; /** * HTML Documentation for Location */ class Location { } class Application : ilcde::Collector { visibility= protected; assigns a Cpp property for the category assigns OPML property defines “christmas::Location” Class super class OPML

Stereotypes Gives a specific semantic to an element Used to set properties on OPML elements <<table>> class EMPLOYEE { ... } class Member { fullName : String { custom = true; readOnly = true; } ... class Member { <<derived>> fullName : String; ... } OPML

Attributes and Roles Attribute: primitive types and external classes class Solution { name : String; <<static>> LastId : ID = "0"; } class Member { birthDate : Date { before; class Location { role family : Family; Attribute: primitive types and external classes Role: reference to one or more objects OPML

Operations parameter return type Default value class Member { operation computeAge( today : Date ): Integer { const; } <<static>> operation DateToInteger( d1 : Date ) : Integer; <<virtual>> operation doIt(); class Family { operation addNewMember( name : String, birthDate : Date = “0”, info : String = “\”no info\”” ); ... OPML Default value

Dependencies Define relations between elements project christmas { ... #include <ilcde/stdtypes.opml> category christmas { cpp.generate = yes; collect; <<import>> depends : ilcde; class ID { id : String; } class Location { declares the “ilcde” category imports “ilcde” category accessible string type OPML

Subsystems and Components Component = logical or physical part Subsystem = group of components component that defines the documentation to be generated project christmas { ... category christmas { } subsystem doccomp { <<documentation>> component ModelDoc { modelDoc.target = html; modelDoc.htmlHome="http://www.ilog.fr"; modelDoc.htmlHelp="help.html"; modelDoc.title="christmas related classes"; depends categories : christmas; OPML selection of categories

Script Language ILOG Implementation of JavaScript Used for Pros Cons Extended with access to C++ classes generated with CDE Interpreted language with “object-oriented” features Used for Cartridge Development Test and Debug Pros Flexible, fast development Clean binding of C++ Good language structure (scopes) Cons No type checking Weak object-oriented model for pure script code

The UML Model Written in OPML Model generated with CDE Parser reads the OPML file and create model in memory Provides powerful property access Script interface for writing generators

Generators Written in Script Control structure in script Generated areas with special comments (//@) A preprocessor adds the write statements … //@class ${clazz.name} { if (clazz.hasConstructor() { //@ ${clazz.name}(); } ...

Preserved Areas Set by the generator The old file is read The content is preserved Note that new file is compared with old file … Generator.printPreserveArea(“beforeClass_”+clazz.name) //@class ${clazz.name} { ... … //beginPreserve beforeClass_MyClass Add user code here //endPreserve beforeClass_MyClass class MyClass { ...

Generation Framework Written in Script A hierarchy of “Controllers” for structure mapping OpmlController : Iterates on UML elements APIController: Generate operations to access the attributes CppController: Provides filtering for C++ Header and Code file generator Tools for element mappings C++ name of a class C++ prototype for an operation

Conclusion CDE OPML Generators with Script Already used with good feedbacks Used within CDE (UML, libraries) OPML Powerful modeling tool, easy to extend. Lack graphic interface. Generators with Script Very flexible (no rigid structure) Easy to write a framework for reuse Lack compile-time checks Lack formal description