Dr. Darius Silingas | No Magic, Inc. Domain-Specific Profiles for Your UML Tool Building DSL Environments with MagicDraw UML
Dr. Darius Silingas | No Magic, Inc. Contents UML Extension Mechanisms MagicDraw DSL Customization Engine Workflow for Creating DSL Environment A Case Study: DSL for Modeling Organization Structure
Dr. Darius Silingas | No Magic, Inc. UML (Unified Modeling Language) De facto standard software modeling language –Standardized for 10 years already –Very popular but still not used by everyone –UML extension mechanisms are not anything new! –UML tools are starting to develop features for DSL
Dr. Darius Silingas | No Magic, Inc. UML Universal Modeling Language
Dr. Darius Silingas | No Magic, Inc. OMG 4 Layer Metamodel
Dr. Darius Silingas | No Magic, Inc. UML Extension Elements Profile is a reusable set of UML extensions Stereotype extends semantics of standard UML metaclass(es) and may also define additional properties and custom appearance icon –Tag Definition specifies additional property that is not available in the extended metaclass(es) Constraint is a rule for domain-specific model correctness or completeness Also: Data Type, Enumeration, …
Dr. Darius Silingas | No Magic, Inc. Stereotype Definition and Application
Dr. Darius Silingas | No Magic, Inc. Contents UML Extension Mechanisms MagicDraw DSL Customization Engine Workflow for Creating DSL Environment A Case Study: DSL for Modeling Organization Structure
Dr. Darius Silingas | No Magic, Inc. Problems of UML Profiles UML modeling environment is too complex Applying stereotype doesn’t hide the UML properties, terminology, etc. Difficult to restrict usage of standard UML elements and ensure model correctness
Dr. Darius Silingas | No Magic, Inc. MagicDraw UML DSL Engine Custom Diagram Wizard –Custom diagram for DSL profile with custom toolbar elements, symbol styles, smart manipulators DSL Customization –DSL stereotype appearance as first-class element –Custom specification editors –Custom context menus –Additional rules for model initialization and restrictions Enhanced UML Profiling –Tag grouping, hiding stereotypes and tags, customizing paths, etc.
Dr. Darius Silingas | No Magic, Inc. Contents UML Extension Mechanisms MagicDraw DSL Customization Engine Workflow for Creating DSL Environment A Case Study: DSL for Modeling Organization Structure
Dr. Darius Silingas | No Magic, Inc. Workflow for Creating DSL Environment 1.Define DSL metamodel 2.Map DSL metamodel to UML profile 3.Create DSL sample 4.Define customizations for stereotypes 5.Define validation rules 6.Create custom DSL diagram 7.Test the created DSL environment
Dr. Darius Silingas | No Magic, Inc. Contents UML Extension Mechanisms MagicDraw DSL Customization Engine Workflow for Creating DSL Environment A Case Study: DSL for Modeling Organization Structure
Dr. Darius Silingas | No Magic, Inc. 1. Define DSL Metamodel
Dr. Darius Silingas | No Magic, Inc. 2. Map DSL Metamodel to UML Profile
Dr. Darius Silingas | No Magic, Inc. 3. Create DSL Sample Should represent all major aspects of DSL!
Dr. Darius Silingas | No Magic, Inc. 4. Create Customizations for Stereotypes Customizations are model elements, part of profile!
Dr. Darius Silingas | No Magic, Inc. 5. Define Validation Rules Employees can be placed only in organization units Validation rules are constraints, part of profile! Possibility to validate the user model against the rule!!
Dr. Darius Silingas | No Magic, Inc. 6. Create Custom DSL Diagram Custom diagrams can be exported to XML descriptors and imported in other machines!
Dr. Darius Silingas | No Magic, Inc. 7. Test the Created DSL Environment Demonstration in MagicDraw UML
Dr. Darius Silingas | No Magic, Inc. Enabling the Full Power of DSL Create DSL-specific transformations –Model reports –DSL-specific patterns –Model 2 Model transformations –Model 2 Code transformations Create guidance for DSL modeling –Project templates –Samples and tutorials –Modeling wizards –Reusable model libraries
Dr. Darius Silingas | No Magic, Inc. Why UML Profiles? Reuse of modeling environment features –Single modeling environment for different roles Possibility to use the extensions in standard UML diagrams –e.g., assign project role to activity swimlane Standardized model data storage and ability to interchange data between tools –MDA tools can be used for code generation
Dr. Darius Silingas | No Magic, Inc. References OMG. Unified Modeling Language: Superstructure –Formal Specification, version 2.1.2, 2007 Bran Selic. A Systematic Approach to Domain- Specific Language Design Using UML Darius Silingas et. al. A Method for Creating Domain-Specific Modeling Environment Based on UML Profiles –Coming out this summer, check
Dr. Darius Silingas | No Magic, Inc. Questions ??? Let’s Keep in Touch! – –Skype: darius.silingas