How to Create Your Own Product-Modeling Environment

52
How to Create Your Own Product Modeling Environment Tim Geisler webXcerpt Software GmbH [email protected] CWG 2011, Marco Island 2011-10-04

Transcript of How to Create Your Own Product-Modeling Environment

Page 1: How to Create Your Own Product-Modeling Environment

How to Create Your OwnProduct Modeling Environment

Tim Geisler

webXcerpt Software GmbH

[email protected]

CWG 2011, Marco Island 2011-10-04

Page 2: How to Create Your Own Product-Modeling Environment

Product Modeling

Page 3: How to Create Your Own Product-Modeling Environment

Product Modeling

Specification Coding in SAP R/3● Materials● BOMs● Classes● Cstics● Procedures● Constraints● Selection Conditions● Interface Designs

Page 4: How to Create Your Own Product-Modeling Environment

Product Modeling Environment

Means for describing product model➔ Textual domain-specific language➔ Tailored to your needs

Tooling➔ Eclipse-based Integrated Development

Environment (IDE)➔ Functionality tailored to your needs

Page 5: How to Create Your Own Product-Modeling Environment

Domain-Specific Languages

Page 6: How to Create Your Own Product-Modeling Environment

Domain-Specific Languages

Domain-specific language (noun): a computer programming language of limited expressiveness focused on a particular domain.

The two main reasons why DSLs are popular:● Improving productivity for developers● Improving communication with domain experts

(Martin Fowler)

Page 7: How to Create Your Own Product-Modeling Environment

Customer Project @

Company-wide generic product structure

NSN VC frameworkIPC extensionscoding conventions

Standardizedproductdescriptions

Page 8: How to Create Your Own Product-Modeling Environment

Customer Project @

Company-wide generic product structure

NSN VC frameworkIPC extensionscoding conventions

productdescriptions

Standardized Formalized

Page 9: How to Create Your Own Product-Modeling Environment

Customer Project @

Company-wide generic product structure

NSN VC frameworkIPC extensionscoding conventions

productdescriptions

Standardized Formalized

Tooling: Eclipse-based IDEsConfigModeler

VClipse

Domain Specific LanguagesCML + CMLUI + CMLT

VCML

Page 10: How to Create Your Own Product-Modeling Environment

ConfigModeler and Vclipse:Two DSLs with Eclipse-based IDE

RFC

Editor/IDE

Editor/IDE

ConfigModeler

VClipse

CML

VCML

Code Generation

Page 11: How to Create Your Own Product-Modeling Environment

CML: Customer's Concepts

product structure

grouping for order structure

logical materials

domains

complex expressions

equations

counting

Page 12: How to Create Your Own Product-Modeling Environment

VCML: SAP's Concepts

Language elements for describing VC objects:

● cstic● class● dependency net● …

Embedded SAP languages for dependencies

Page 13: How to Create Your Own Product-Modeling Environment

Code Generation: CML to VCML

Generate VC objects and dependencies● correct ordering of procedures

Use NSN VC framework● use generic variant functions● use generic cstics● use generic procedures and dependency nets● respect NSN naming conventions

Code generation on the fly● using Eclipse builder infrastructure

Page 14: How to Create Your Own Product-Modeling Environment

Interfacing SAP

Two mechanisms for interfacing SAP● ALE via IDocs (Product Data Replication)● create/change/read/delete objects via RFC

Reading objects via RFC● Model extraction from SAP to VCML

No extraction of CML from SAP possible!

Page 15: How to Create Your Own Product-Modeling Environment

IDE: Tooling for Modelers

Page 16: How to Create Your Own Product-Modeling Environment

IDE: Tooling for Modelers

Syntax checking

Cross references

Semantic checking

Page 17: How to Create Your Own Product-Modeling Environment

IDE: Tooling for Modelers

Outline

Templates Content AssistFolding

Renamerefactoring

Page 18: How to Create Your Own Product-Modeling Environment

Companion Languages

Page 19: How to Create Your Own Product-Modeling Environment

Companion Language I: CMLUINSN UI Enhancement Framework

Framework for describing

● widgets (headings, checkboxes, notes, …) and

● layout (columns, font, color, spacing)

Old: Maintenance Dialogs New: DSL + IDE Tooling

Page 20: How to Create Your Own Product-Modeling Environment

Companion Language II: CMLTAutomated Model Testing

Test tool at NSN:Fysbee's ConfigScan

DSL for describing test cases usingCML concepts

Page 21: How to Create Your Own Product-Modeling Environment

Companion Language II: CMLTTest-Case Execution

● Remote call of ConfigScan from ConfigModeler

● Display of test results in separate view

● Navigation to corresponding test statement in test-case language

Page 22: How to Create Your Own Product-Modeling Environment

Companion Language II: CMLTSupport for Test-Case Maintenance

● Test-coverage analysis (static)Is there a test case for each material, cstic, ...?

● Fully integrated languages CML / CMLT

● Robustness: generation of ConfigScan code● Import of test cases from IPC export files

Page 23: How to Create Your Own Product-Modeling Environment

Use of ConfigModeler @

More than 100 product models are currently in development using ConfigModeler.

(prototypes not included)

About 50% of these product models are already on production system.

About 50% of all product models on production system have been built with ConfigModeler.

(size and complexity not taken into account)

Page 24: How to Create Your Own Product-Modeling Environment

Showtime

Page 25: How to Create Your Own Product-Modeling Environment

Product “hiT 7030”

Multiplexes STM-1/STM-4 to 2M, 34/45M, STM-1, STM4

1 uplink board with 2 SFP module slots

3 downlink boards with 0-6 SFP module slots

Page 26: How to Create Your Own Product-Modeling Environment
Page 27: How to Create Your Own Product-Modeling Environment

Life Demo: Modeling with DSLs

Page 28: How to Create Your Own Product-Modeling Environment

Demo: Deployment to SAP

● Using PDR

Page 29: How to Create Your Own Product-Modeling Environment
Page 30: How to Create Your Own Product-Modeling Environment

Technology in Use

Open source technology based on Java● Eclipse: IDE platform● Xtext:

● domain-specific language framework● ANTLR-based parser● IDE generated automatically● adaptable via dependency injection (Google Guice)

● EMF: Eclipse Modeling Framework

SAP JCo / IDocs library

Page 31: How to Create Your Own Product-Modeling Environment

VClipse is Free

Page 32: How to Create Your Own Product-Modeling Environment

VClipse is Free

Page 33: How to Create Your Own Product-Modeling Environment

VClipse.org: Open Source

Use, adapt, integrate, contribute!

Page 34: How to Create Your Own Product-Modeling Environment

Use Cases for VClipse

Mass upload (of parts) of configuration

Model comparison– Use textual or EMF diff tools to compare models

Model versioning– use version control system for textual models

Model refactoring– rename objects, move cstics

Model validation– check own naming conventions– check for syntactic and semantic errors

Page 35: How to Create Your Own Product-Modeling Environment

How to Create Your OwnProduct Modeling Environment?

Page 36: How to Create Your Own Product-Modeling Environment

Product Modeling Environment @ NSN

RFC

Editor/IDE

Editor/IDE

ConfigModeler

VClipse

CML

VCML

Code Generation

Page 37: How to Create Your Own Product-Modeling Environment

My Own Product-Modeling Environment

RFC

Editor/IDE

Editor/IDE

my ConfigModeler

VClipse

myCML

VCML

my Code Generation

Page 38: How to Create Your Own Product-Modeling Environment

Building Blocks

Metamodel

Editor/IDE

my ConfigModeler

myCML

my Code Generation

Scoping + ValidationTarget Architecture

Grammar

Import fromLegacy Configurators

or Specifications Export / Reports Vclipse adaptions

Code Generation

IDE adaptions

Page 39: How to Create Your Own Product-Modeling Environment

Defining yourModeling-Language Grammar

● using the Xtext grammar language

● from this grammar, the following is derived:● metamodel (Ecore + Java classes)● parser● editor with syntax highlighting, content assist,

outline, folding, ...

Page 40: How to Create Your Own Product-Modeling Environment

Defining yourModeling-Language Metamodel

Represents all product models in the domain(like a schema)● EMF Ecore Meta Model● Generated from grammar or defined separately● Source of transformation

Page 41: How to Create Your Own Product-Modeling Environment

Scoping + ValidationLanguage Aspects not Represented in Grammar Scoping: visibility of objects for cross-references

Validation: checks for complex model properties

Page 42: How to Create Your Own Product-Modeling Environment

Defining yourTarget Architecture

Clear: SAP Variant ConfigurationOpen aspects:

● Naming conventions● Which objects should be modeled?● Constraints / conditions on values?● BOM calculation● Use of variant tables● Use of certain variant functions● …

Might be very company-specific!

Page 43: How to Create Your Own Product-Modeling Environment

Code Generation

Task: map myCML models (instances of your metamodel) to VCML models● Respect your target architecture● Various means to implement:

● Java● EMF model transformation languages

Page 44: How to Create Your Own Product-Modeling Environment

IDE Adaptions● Xtext-based editors are highly configurable

through dependency injection using Google Guice

● Nearly each part of system can be adapted and replaced.

Page 45: How to Create Your Own Product-Modeling Environment

Import from Legacy Configurators● Task: map models of your legacy configurator to

xCML models● Various means to implement, depending on

your legacy configurator:● Extension of legacy transformator● XML transformation using e.g. XSLT● Implement DSL for legacy configurator

use model 2 model transformation to transform to xCML

● ...

Page 46: How to Create Your Own Product-Modeling Environment

Export / Reports● Use EMF model to text transformation language ●

Page 47: How to Create Your Own Product-Modeling Environment

Features for Free● Due to the use of Eclipse as platform,

you get a lot of features for free:● Integration of all modern version control systems

(CVS, Subversion, Git, …)● Textual file comparison● Task-focused work using Mylyn● Integration of bug-tracking systems● Query / replace with regular expressions● ...

Page 48: How to Create Your Own Product-Modeling Environment

Conclusion

Page 49: How to Create Your Own Product-Modeling Environment

Conclusion

Textual Domain-Specfic Languages● suitable for product modeling● modern tooling easy to create with Eclipse/Xtext

VClipse● interface to SAP system when using DSLs ● open-source tool useful for various modeling tasks

How to create your own product-modeling environment● identified several building blocks

Page 50: How to Create Your Own Product-Modeling Environment

Thanks to ...

● various persons at Nokia Siemens Networks● Peter Muthsam & Michael Wilhelm (SAP VC)● Fysbee team for ConfigScan support● Daniel Naus (CWG Sandbox)● various persons at itemis (Xtext)● webXcerpt team

Page 51: How to Create Your Own Product-Modeling Environment

How could product modeling with textual DSLslook like for your domain and your company?

Page 52: How to Create Your Own Product-Modeling Environment