SMartyParser: an XMI Parser for UML-based Software Product Line Variability Models
Upcoming SlideShare
Loading in...5
×
 

SMartyParser: an XMI Parser for UML-based Software Product Line Variability Models

on

  • 659 views

 

Statistics

Views

Total Views
659
Views on SlideShare
659
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
1

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

SMartyParser: an XMI Parser for UML-based Software Product Line Variability Models SMartyParser: an XMI Parser for UML-based Software Product Line Variability Models Presentation Transcript

  • SMartyParser: an XMI Parser forUML-based Software Product Line Variability Models Leandro A. Lanceloti State University of Maringá (DIN-UEM) – Brasil José C. Maldonado University of São Paulo (ICMC-USP) – Brasil Itana M. S. Gimenes State University of Maringá (DIN-UEM) – Brasil Edson A. Oliveira Junior edson@din.uem.br State University of Maringá (DIN-UEM) - Brasil
  • Outlinesl  Introductionl  XMI for Metadata Interchangel  The Parser for UML-based SPLsl  SMartyParser Running Examplel  Conclusions and On Going Works SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 2
  • Introductionl  Variability Management (VM) is a key issue for the success of SPLsl  Literature presents several well-known approaches for VM, specially object-orientedl  Several tools have been developed, such as, pure::variants and SPLOT l  however, a subset of the VM approaches is UML-based and requires automated support for UML models l  Tools have particular means to handle variabilities SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 3 View slide
  • Introductionl  Supporting for UML-based SPL models might be provided by XMI filesl  Several questions: l  How to handle UML-based SPLs models containing variability in a particular environment? l  Do you have to adapt your environment to comply to existing tools? l  How do you interchange SPL metadata between different environments? l  … SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 4 View slide
  • The OMG’s XMI Standardl  XMI is the OMG’s standard for metadata interchangingl  Plain XML parsers do not accurately support XMI files 1 <?xml version = 1.0 encoding = UTF-8 ?> 2 <XMI xmi.version = 1.2 3 xmlns:UML = org.omg.xmi.namespace.UML 4 xmlns:UML2 = org.omg.xmi.namespace.UML2 5 timestamp = Tue Mar 06 20:22:06 BRT 2012> 6 <XMI.content> 7 <UML:Diagram xmi.id = Iae204f0m135cde62a90mm58a3 8 isVisible = true 9 name = AGM - Core Assets 10 zoom = 0.91> 11 <UML:GraphElement.semanticModel> 12 <UML:SimpleSemanticModelElement 13 xmi.id = Iae204f0m135cde62a90mm7e5f 14 typeInfo = ClassDiagram/> 15 </UML:GraphElement.semanticModel> 16 <UML:GraphElement.contained> 17 ... SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 5 18 ...
  • Processing XMI Files l  Metamodel Definition File (MDF) 203 204 <modelelement name="stereotype"> 205 <attribute name="context" type="ref"/> 206 <attribute name="id" type="data"/> 207 <attribute name="name" type="data"/> 208 <attribute name="extendedelements" 209 type="ref" multiplicity="many"/> 210 </modelelement> 211 Figure 2: Excerpt of the MDF Structure Elements. l  212 XMI Transformation File (XTF)Figure 2: Excerpt of the MDF Structure Elements. 461 462 <xmitransformation modelelement="stereotype" 463 xmipattern="UML:Stereotype"> 464 <trigger name="id" type="attrval" attr="xmi.id"/> 465 <trigger name="name" type="attrval" attr="name"/> 466 <trigger name="context" type="gcattrval" 467 src="UML:ModelElement.namespace" 468 attr="xmi.idref"/> 469 <trigger name="extendedelements" type="gcattrval" 470 src="UML:Stereotype.extendedElement" 471 attr="xmi.idref" 472 linkbackattr="stereotypes" /> 473 </xmitransformation> 474 SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 475 6
  • The SMartyParserl  SMartyParser stands for Stereotype-based Management of Variability Parser l  It is aimed at processing XMI files of UML-based SPL models in which variabilities are represented by means of stereotypes (UML profiles)l  It was built taking as a basis the Open Core Framework, from the SDMetrics projectl  Open Core provides Java classes for: l  Parsing XMI files l  Define and apply metrics for OO models SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 7
  • SMartyParser Class DiagramSMartyParser Class Model com.sdmetrics.model * 1 1 MetaModelElement MetaModel 1 1 br.uem.din.les.parserxmi * * * * 1 1 1 1 1 ModelElement Model XMIReader ProductLineModelParser * XMITrigger IProductLineVariabilityParser * 1 1 IProductLineUMLModelParser * 1 XMITransformation Transformati XMITransformations Figure 4: The SMartyParser Class Model. SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 8
  • Figure 4: The SMartyParser Class Model.SMartyParser Available OperationsTable 1: The SMartyParser Available Operations.Interface Method Description getAllDiagrams Get all diagrams from the UML model IProductLineUM getStructureDiagrams Get structural diagram LModelParser getBehaviourDiagrams Get behavioral diagrams getInteractionDiagrams Get interaction diagrams getElementsByDiagram Get all elements of a given diagram getElementsByDiagramByType Get all elements of a given diagram by type getElementByID Get an element by its ID getElementsByType Get all elements of a given type getAllVariabilities Get all variabilities (as UML comments) IProductLineVariabilityParser getAllVariationPoints Get all variation points getAllVariables Get all variable elements getOptionalVariants Get all optional variants getMandatoryVariants Get all mandatory variants getInclusiveVariants Get all inclusive variants getExclusiveVariants Get all exclusive variants getVariabilityByName Get a variability by its name getVariantsOfAVariability Get all variants of a given variability getVariationPointOfAVariant Get the variation point of a given variant getChildrenVariabilities Get all child variabilities from a given variability getVariantRequiredElements Get all variants required by a given variant getVariantMutexElements Get all mutually exclusive variants of a given variant SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 9
  • The SMartyParserl  SMartyParser was conceived based on the main UML- based variability management concepts: l  Variation Point l  Variant (mandatory, optional, inclusive, exclusive) l  Constraints between Variants (requires, mutex) SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 10
  • SMartyParser ConfigurationTable 2: The SMartyParser Configuration File TaPropertiesAvailable Properties. Ste Property Description uml_version the UML version xmi_version the XMI version related XMI- xmi_xtf_file_location the XTF file location xmi_mdf_file_location the MDF file location xmi_model_file_location the XMI file location the stereotype used for representing variability_stereotype variabilities the stereotype used for representing variation_point_stereotype variation points the stereotype used for representing mandatory_variant mandatory variants Stereotype-related the stereotype used for representing optional_variant optional variants the stereotype used for representing inclusive_variant inclusive variants the stereotype used for representing exclusive_variant exclusive variants the stereotype used for representing variable_stereotype variable elements the stereotype used for representing require_constraint require constraints the stereotype used for representing mutually_exclusive_variant mutually exclusive constraints SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 11
  • SMartyParser Instantiationl  It is instantiated by running the following code: ProductLineModelParser smartyParser = new ProductLineModelParser();l  The constructor is responsible for: l  reading the respective files (MDF and XTF) indicated in the SMartyParser configuration file; and l  processing the XMI file SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 12
  • SMartyParser Variability Concepts and Example Stereotypese 3: Correspondence Between the SMeotypes and Variability Concepts. Variability Concept SMartyProfile Stereotype Variability «variability» Variation Point «variationPoint» Mandatory Variant «mandatory» Optional Variant «optional» Inclusive Variant «alternative_OR» Exclusive Variant «alternative_XOR» Require Constraint «requires» Mutually Exclusive Constraint «mutex» Variable Elements «variable» SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 13
  • Annotated Arcade Game Maker Use Case Model <<variability>> << optional >> << requires >> << optional >> name = "save score" minSelection = 0 Check Previous Best Score Save Score maxSelection = 1 bindingTime = DESIGN_TIME << mandatory >> << mandatory >> allowsAddingVar = true Install Game variants = {Save Score} <<variability>> << mandatory >> name = "check score" << mandatory >> Save Game minSelection = 0 maxSelection = 1 << mandatory >> bindingTime = DESIGN_TIME Exit Game GamePlayer allowsAddingVar = true variants = {Check Previous Best Score} << mandatory , variationPoint >> Play Selected Game GameInstaller Extension Points <<variability>> initialization_ext_point: name = "play game" << mandatory >> animation_ext_point: minSelection = 1 stance maxSelection = 3 Uninstall Game bindingTime = DESIGN_TIME result allowsAddingVar = true variants = {Play Brickels, << extend >> << extend >> << extend >> class, Play Pong, Play Bowling} UML << alternative_OR >> Play Pong << alternative_OR >> << alternative_OR >>nts the Play Brickles Play Bowlingnd it is << include >> << include >> << include >> << include >> esents << mandatory >> << include >> << include >> << mandatory >> lasses, Initialization Animation Loop ement meta- SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 14
  • Executing SMartyParserl  To obtain all the diagrams, as a collection, one must invoke the following operation: smartyParser.getAllDiagrams();l  For the AGM example, such an operation returns the following diagram as a ModelElement instance: l  [AGM - Use Case Model] SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 15
  • Executing SMartyParserl  to obtain all variation points from the SPL models, one can invoke the following operation: smartyParser.getAllVariationPoints();l  For the AGM example, such an operation returns the following variation points: l  [Play Selected Game] SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 16
  • Conclusionsl  SMartyParser can be easily integrated to specific environments for UML-based SPLsl  The parser provides several operations based on UML models and their variabilities represented as stereotypesl  SMartyParser only requires one to properly configure its configuration file avoiding misunderstanding of variability concepts from de UML models SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 17
  • Limitations and On Going Worksl  Limitations of the parser includes: l  variability representation based on stereotypes; l  lack of an OCL engine for improving variability comprehension and automatic product generation; and l  the parser only processes use case, class, component and activity diagrams.. so far….l  On going works include: l  the parser is being currently extended for sequence diagrams, the UML package merging mechanism, SysML block definition for ES, and the SPEM elements for process lines SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 18
  • Questions? Contributions?l  If you prefer, contact me via e-mail: l  edson@din.uem.br SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 19
  • l  Obrigado !!!l  Grazie!!!l  Thank you ! ! ! SMartyParser: a XMI Parser for UML-based Variability Models – VaMoS 2013 – Edson Jr. 20