How to Create Your Own Product Modeling Environment Tim Geisler webXcerpt Software GmbH tg@webxcerpt.com CWG 2011, Marco Island 2011-10-04 Product Modeling Product Modeling Specification Coding in SAP R/3 ● Materials ● BOMs ● Classes ● Cstics ● Procedures ● Constraints ● Selection Conditions ● Interface Designs 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 Domain-Specific Languages 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) Customer Project @ Company-wide generic product structure Standardized product descriptions NSN VC framework IPC extensions coding conventions Customer Project @ Company-wide generic product structure Standardized Formalized product descriptions NSN VC framework IPC extensions coding conventions Customer Project @ Domain Specific Languages CML + CMLUI + CMLT VCML Company-wide generic product structure Standardized Formalized product descriptions NSN VC framework IPC extensions coding conventions Tooling: Eclipse-based IDEs ConfigModeler VClipse ConfigModeler and Vclipse: Two DSLs with Eclipse-based IDE ConfigModeler CML Editor/IDE Code Generation VClipse Editor/IDE VCML RFC CML: Customer's Concepts product structure grouping for order structure logical materials domains complex expressions equations counting VCML: SAP's Concepts Language elements for describing VC objects: ● cstic ● class ● dependency net ● … Embedded SAP languages for dependencies 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 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! IDE: Tooling for Modelers IDE: Tooling for Modelers Syntax checking Semantic checking Cross references IDE: Tooling for Modelers Rename refactoring Outline Folding Templates Content Assist Companion Languages Companion Language I: CMLUI NSN UI Enhancement Framework Framework for describing ● ● Old: Maintenance Dialogs widgets (headings, checkboxes, notes, …) and layout (columns, font, color, spacing) New: DSL + IDE Tooling Companion Language II: CMLT Automated Model Testing Test tool at NSN: Fysbee's ConfigScan DSL for describing test cases using CML concepts Companion Language II: CMLT Test-Case Execution ● ● ● Remote call of ConfigScan from ConfigModeler Display of test results in separate view Navigation to corresponding test statement in test-case language Companion Language II: CMLT Support 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 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) Showtime 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 Life Demo: Modeling with DSLs Demo: Deployment to SAP ● Using PDR 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 VClipse is Free VClipse is Free VClipse.org: Open Source Use, adapt, integrate, contribute! 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 How to Create Your Own Product Modeling Environment? Product Modeling Environment @ NSN ConfigModeler CML Editor/IDE Code Generation VClipse Editor/IDE VCML RFC My Own Product-Modeling Environment my ConfigModeler myCML Editor/IDE my Code Generation VClipse Editor/IDE VCML RFC Building Blocks Scoping + Validation Metamodel Target Architecture Grammar Code Generation my ConfigModeler Editor/IDE myCML my Code Generation Import from Legacy Configurators or Specifications IDE adaptions Export / Reports Vclipse adaptions Defining your Modeling-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, ... Defining your Modeling-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 Scoping + Validation Language Aspects not Represented in Grammar Scoping: visibility of objects for cross-references Validation: checks for complex model properties Defining your Target Architecture Clear: SAP Variant Configuration Open 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! 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 IDE Adaptions ● ● Xtext-based editors are highly configurable through dependency injection using Google Guice Nearly each part of system can be adapted and replaced. 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 ... Export / Reports ● ● Use EMF model to text transformation language 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 ● ... Conclusion 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 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 How could product modeling with textual DSLs look like for your domain and your company?
© Copyright 2024