SlideShare una empresa de Scribd logo
1 de 24
Improving Naming and Grouping in UML Antonio Vallecillo Universidad de Málaga, Spain http://www.lcc.uma.es/~av
Context Specification of non-trivial systems using UML and ODP UML as base language UML4ODP Profiles to represent ODP concepts Viewpoint Modeling to structure the systems specs Five viewpoints  Correspondences between them  Retail, eHealth, Aerospace Heterogeneous Federated modeling ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 2
UML package The package is the UML mechanism for groupingmodeling elements Provides a namespace for its members (P::x) Owns its members (if a package is removed from a model, so are its members) PackageImport Allows using unqualified namesto refer to elements in other packages PackageMerge Allows extending the contents of one package with the contents from another The receiving package is modified, being replaced by the duplicate-free union of the two packages Names are used to identify corresponding elements     [Import deals with naming issues, Merge deals with contents] ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 3
Issues ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 4
Issues about the UML package itself Imposes a hierarchical tree structure, in which one model element cannot belong to more than one package No flexible organization schema  Sometimes we want to group elements according to several criteria (there is no single organizational criteria that fits all purposes) Elements  may have at most one name This assumes a single global naming scheme It hinders heterogeneous federated modeling ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 5
Issues about PackageImport It does not work well with name clashes Name resolution is complex or even impossible sometimes Has side-effects The situation gets worse under the presence of OCL ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 6 [In this diagram, the OCL constraint in package P refers with no problems to class A in the outer package]
Issues about PackageImport It does not work well with name clashes Name resolution is complex or even impossible sometimes Has side-effects The situation gets worse under the presence of OCL ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 7 [Now, the OCL constraint refers to class A in package Q, which can cause problems if there is no age attribute in A]
Issues about PackageImport It does not work well with name clashes Name resolution is complex or even impossible sometimes Has side-effects The situation gets worse under the presence of OCL ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 8 [Now the OCL constraint refers back to class A in Outer package! Class C cannot be directly referenced any more]
Issues about PackageMerge Complex semantics Complex side-effects No warning of problems No tool support Complex behaviour when used under the presence of PackageImport UML specification explicitly mentions it is only intended for expert modelers ("Don't do this at home") ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 9
Our proposal ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 10
A more flexible grouping schema A group is  “a set of objects with a particular relationship that  characterizes either the structural relationship among  objects, or an expected common behaviour”  [RM-ODP Part 2, clause 10.1] ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 11
A more flexible grouping schema A group is  “a set of objects with a particular relationship that  characterizes either the structural relationship among  objects, or an expected common behaviour”  [RM-ODP Part 2, clause 10.1] Have you used Gmail grouping scheme using labels?  ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 12
A more flexible Naming schema A namespace is a set of terms usable as names (strings, icons, …) A naming context establishes the relations between names and entities A name is a term that refers to an entity, in a naming context A naming action associates a name to an entity Naming contexts are named elements ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 13 [ISO 14771: ODP Naming Framework, 1999]
Some examples ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 14 “perro” = “Inglés::dog”
Name resolution Given an identifier and a naming context, name resolution consists of finding a naming action for the identifier context Identifier::resolve(C : NamingContext) : NamedElementbody: self.namingAction->any(namingContext = C).entity context Identifier::canResolve(C : NamingContext) : Boolean   	body: self.namingAction->exists(namingContext = C) The opposite operation is not that simple contextNamedElement::name(C : NamingContext) : Identifier   	body: self.namingAction->any(namingContext = C).name 	…the problem is that this element may not be in that naming context but in others (indirect naming). ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 15
Putting it all together ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 16
The new elements ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 17
Back to the future… Integrating all this in UML ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 18
Packages and groups can be used together in specifications contextPackageableElement::name : Identifier   derive: self.name(self.group.namingContext)) context Package inv NamesItsElements:   self.member->forAll(name = name(self.namingContext)) Groups and Packages ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 19
PackageImport Why is there any need for PackageImport? The need for PackageImport in UML is due to the dual nature of Packages as groups and as naming contexts, and that packages are the exclusive owners their members PackageImport is needed be able to use an unqualified name to refer to an entity owned by another package In our proposal it is enough to add its name to the naming context associated to the group ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 20
New import operations contextNamingContext::import(n : Identifier, e : NamedElement) : Boolean   post:  if (self.namingAction.name->excludes(n)  and self.namingAction.entity->excludes(e))  then result = true and  self.namingAction-> includes (na | na.name = n and na.entity = e)         elseresult = ( n.resolve(self) = e )         endif contextGroup::import(n : Identifier, e : NamedElement): Boolean       body: self.namingContext.import(n,e) contextGroup::include( n : Identifier )       pre: n.canResolve(self.namingContext)       post: self.member->includes(n.resolve(self.namingContext)) ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 21
Merging ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 22
A new semantics for Merge It now creates a new group with the result of the merge Side-effect free User-defined merging operation between elements ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 23
Conclusions New UML grouping and naming mechanisms Elements can belong to more than one group Elements can have different names in different contexts Pros Backwards compatible with UML (almost) Package is a kind of Group Element names are now derived attributes Import and Merge operations ironed out Side-effects free Clear conflict detection Aligned with existing and mature international standards Cons UML may ignore it… Future work Synonyms, refinement of operation specifications, fine-tuning of constraints (e.g., name+types), tool support for operations UML “redefines”  ECMFA 2011 A. Vallecillo:   "Improving Naming and Grouping in UML" 24

Más contenido relacionado

Destacado

La ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesLa ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesAntonio Vallecillo
 
8 Martie
8 Martie8 Martie
8 Martielumik
 
Orchids And Thoughts[1] Ik Ro
Orchids And Thoughts[1] Ik RoOrchids And Thoughts[1] Ik Ro
Orchids And Thoughts[1] Ik Rolumik
 
Cerul Si Pamantul
Cerul Si PamantulCerul Si Pamantul
Cerul Si Pamantullumik
 
Lettre Escale0001
Lettre Escale0001Lettre Escale0001
Lettre Escale0001ifiemaga
 
Keanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup NnKeanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup Nnmaryadivm
 
Keanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup NnKeanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup Nnmaryadivm
 
Ganduri Pozitive
Ganduri PozitiveGanduri Pozitive
Ganduri Pozitivelumik
 
Manualul Scolii lui Andrei editia 2010
Manualul Scolii lui Andrei editia 2010Manualul Scolii lui Andrei editia 2010
Manualul Scolii lui Andrei editia 2010taraluiandrei
 

Destacado (9)

La ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesLa ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidades
 
8 Martie
8 Martie8 Martie
8 Martie
 
Orchids And Thoughts[1] Ik Ro
Orchids And Thoughts[1] Ik RoOrchids And Thoughts[1] Ik Ro
Orchids And Thoughts[1] Ik Ro
 
Cerul Si Pamantul
Cerul Si PamantulCerul Si Pamantul
Cerul Si Pamantul
 
Lettre Escale0001
Lettre Escale0001Lettre Escale0001
Lettre Escale0001
 
Keanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup NnKeanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup Nn
 
Keanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup NnKeanekaragaman Mahkluk Hidup Nn
Keanekaragaman Mahkluk Hidup Nn
 
Ganduri Pozitive
Ganduri PozitiveGanduri Pozitive
Ganduri Pozitive
 
Manualul Scolii lui Andrei editia 2010
Manualul Scolii lui Andrei editia 2010Manualul Scolii lui Andrei editia 2010
Manualul Scolii lui Andrei editia 2010
 

Similar a Improving Naming and Grouping in UML

Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Ricardo Quintero
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCLEdward Willink
 
A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)
A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)
A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)Elena Planas
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5Mahmoud Ouf
 
Introduction to Drools
Introduction to DroolsIntroduction to Drools
Introduction to Droolsgiurca
 
free Video lecture in India
free Video lecture in Indiafree Video lecture in India
free Video lecture in IndiaEdhole.com
 
UML as a Programming Language
UML as a Programming LanguageUML as a Programming Language
UML as a Programming LanguageEd Seidewitz
 
IntroductionToUML.ppt
IntroductionToUML.pptIntroductionToUML.ppt
IntroductionToUML.pptssuser1028f8
 
Acceleo Best Practices - Obeo.pdf
Acceleo Best Practices - Obeo.pdfAcceleo Best Practices - Obeo.pdf
Acceleo Best Practices - Obeo.pdfClaudiaNaveda2
 
Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Umlguest514814
 
Java™ (OOP) - Chapter 8: "Objects and Classes"
Java™ (OOP) - Chapter 8: "Objects and Classes"Java™ (OOP) - Chapter 8: "Objects and Classes"
Java™ (OOP) - Chapter 8: "Objects and Classes"Gouda Mando
 

Similar a Improving Naming and Grouping in UML (20)

Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCL
 
OOAD
OOADOOAD
OOAD
 
A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)
A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)
A Framework for Verifying UML Behavioral Models (CAiSE Doctoral Consortium 2009)
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Uml introduciton
Uml introducitonUml introduciton
Uml introduciton
 
ooAD
ooADooAD
ooAD
 
Aligning OCL and UML
Aligning OCL and UMLAligning OCL and UML
Aligning OCL and UML
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 
Introduction to Drools
Introduction to DroolsIntroduction to Drools
Introduction to Drools
 
UML Design.pptx
UML Design.pptxUML Design.pptx
UML Design.pptx
 
free Video lecture in India
free Video lecture in Indiafree Video lecture in India
free Video lecture in India
 
UML as a Programming Language
UML as a Programming LanguageUML as a Programming Language
UML as a Programming Language
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
IntroductionToUML.ppt
IntroductionToUML.pptIntroductionToUML.ppt
IntroductionToUML.ppt
 
Acceleo Best Practices - Obeo.pdf
Acceleo Best Practices - Obeo.pdfAcceleo Best Practices - Obeo.pdf
Acceleo Best Practices - Obeo.pdf
 
Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Uml
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Java™ (OOP) - Chapter 8: "Objects and Classes"
Java™ (OOP) - Chapter 8: "Objects and Classes"Java™ (OOP) - Chapter 8: "Objects and Classes"
Java™ (OOP) - Chapter 8: "Objects and Classes"
 

Más de Antonio Vallecillo

Modeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsModeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsAntonio Vallecillo
 
Introducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsIntroducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsAntonio Vallecillo
 
Using UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsUsing UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsAntonio Vallecillo
 
Modeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLModeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLAntonio Vallecillo
 
Modeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyModeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyAntonio Vallecillo
 
Research Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainResearch Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainAntonio Vallecillo
 
Belief Uncertainty in Software Models
Belief Uncertainty in Software ModelsBelief Uncertainty in Software Models
Belief Uncertainty in Software ModelsAntonio Vallecillo
 
Adding Random Operations to OCL
Adding Random Operations to OCLAdding Random Operations to OCL
Adding Random Operations to OCLAntonio Vallecillo
 
Extending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationExtending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationAntonio Vallecillo
 
Towards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringTowards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringAntonio Vallecillo
 
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...Antonio Vallecillo
 
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoLa Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoAntonio Vallecillo
 
Los Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaLos Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaAntonio Vallecillo
 
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...Antonio Vallecillo
 
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...Antonio Vallecillo
 
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...Antonio Vallecillo
 

Más de Antonio Vallecillo (16)

Modeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsModeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain Behaviors
 
Introducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsIntroducing Subjective Knowledge Graphs
Introducing Subjective Knowledge Graphs
 
Using UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsUsing UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital Twins
 
Modeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLModeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCL
 
Modeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyModeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of Uncertainty
 
Research Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainResearch Evaluation - The current situation in Spain
Research Evaluation - The current situation in Spain
 
Belief Uncertainty in Software Models
Belief Uncertainty in Software ModelsBelief Uncertainty in Software Models
Belief Uncertainty in Software Models
 
Adding Random Operations to OCL
Adding Random Operations to OCLAdding Random Operations to OCL
Adding Random Operations to OCL
 
Extending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationExtending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured Information
 
Towards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringTowards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software Engineering
 
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
 
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoLa Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
 
Los Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaLos Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de Málaga
 
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
 
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
 
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
 

Improving Naming and Grouping in UML

  • 1. Improving Naming and Grouping in UML Antonio Vallecillo Universidad de Málaga, Spain http://www.lcc.uma.es/~av
  • 2. Context Specification of non-trivial systems using UML and ODP UML as base language UML4ODP Profiles to represent ODP concepts Viewpoint Modeling to structure the systems specs Five viewpoints Correspondences between them Retail, eHealth, Aerospace Heterogeneous Federated modeling ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 2
  • 3. UML package The package is the UML mechanism for groupingmodeling elements Provides a namespace for its members (P::x) Owns its members (if a package is removed from a model, so are its members) PackageImport Allows using unqualified namesto refer to elements in other packages PackageMerge Allows extending the contents of one package with the contents from another The receiving package is modified, being replaced by the duplicate-free union of the two packages Names are used to identify corresponding elements [Import deals with naming issues, Merge deals with contents] ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 3
  • 4. Issues ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 4
  • 5. Issues about the UML package itself Imposes a hierarchical tree structure, in which one model element cannot belong to more than one package No flexible organization schema Sometimes we want to group elements according to several criteria (there is no single organizational criteria that fits all purposes) Elements may have at most one name This assumes a single global naming scheme It hinders heterogeneous federated modeling ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 5
  • 6. Issues about PackageImport It does not work well with name clashes Name resolution is complex or even impossible sometimes Has side-effects The situation gets worse under the presence of OCL ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 6 [In this diagram, the OCL constraint in package P refers with no problems to class A in the outer package]
  • 7. Issues about PackageImport It does not work well with name clashes Name resolution is complex or even impossible sometimes Has side-effects The situation gets worse under the presence of OCL ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 7 [Now, the OCL constraint refers to class A in package Q, which can cause problems if there is no age attribute in A]
  • 8. Issues about PackageImport It does not work well with name clashes Name resolution is complex or even impossible sometimes Has side-effects The situation gets worse under the presence of OCL ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 8 [Now the OCL constraint refers back to class A in Outer package! Class C cannot be directly referenced any more]
  • 9. Issues about PackageMerge Complex semantics Complex side-effects No warning of problems No tool support Complex behaviour when used under the presence of PackageImport UML specification explicitly mentions it is only intended for expert modelers ("Don't do this at home") ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 9
  • 10. Our proposal ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 10
  • 11. A more flexible grouping schema A group is “a set of objects with a particular relationship that characterizes either the structural relationship among objects, or an expected common behaviour” [RM-ODP Part 2, clause 10.1] ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 11
  • 12. A more flexible grouping schema A group is “a set of objects with a particular relationship that characterizes either the structural relationship among objects, or an expected common behaviour” [RM-ODP Part 2, clause 10.1] Have you used Gmail grouping scheme using labels?  ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 12
  • 13. A more flexible Naming schema A namespace is a set of terms usable as names (strings, icons, …) A naming context establishes the relations between names and entities A name is a term that refers to an entity, in a naming context A naming action associates a name to an entity Naming contexts are named elements ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 13 [ISO 14771: ODP Naming Framework, 1999]
  • 14. Some examples ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 14 “perro” = “Inglés::dog”
  • 15. Name resolution Given an identifier and a naming context, name resolution consists of finding a naming action for the identifier context Identifier::resolve(C : NamingContext) : NamedElementbody: self.namingAction->any(namingContext = C).entity context Identifier::canResolve(C : NamingContext) : Boolean body: self.namingAction->exists(namingContext = C) The opposite operation is not that simple contextNamedElement::name(C : NamingContext) : Identifier body: self.namingAction->any(namingContext = C).name …the problem is that this element may not be in that naming context but in others (indirect naming). ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 15
  • 16. Putting it all together ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 16
  • 17. The new elements ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 17
  • 18. Back to the future… Integrating all this in UML ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 18
  • 19. Packages and groups can be used together in specifications contextPackageableElement::name : Identifier derive: self.name(self.group.namingContext)) context Package inv NamesItsElements: self.member->forAll(name = name(self.namingContext)) Groups and Packages ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 19
  • 20. PackageImport Why is there any need for PackageImport? The need for PackageImport in UML is due to the dual nature of Packages as groups and as naming contexts, and that packages are the exclusive owners their members PackageImport is needed be able to use an unqualified name to refer to an entity owned by another package In our proposal it is enough to add its name to the naming context associated to the group ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 20
  • 21. New import operations contextNamingContext::import(n : Identifier, e : NamedElement) : Boolean post: if (self.namingAction.name->excludes(n) and self.namingAction.entity->excludes(e)) then result = true and self.namingAction-> includes (na | na.name = n and na.entity = e) elseresult = ( n.resolve(self) = e ) endif contextGroup::import(n : Identifier, e : NamedElement): Boolean body: self.namingContext.import(n,e) contextGroup::include( n : Identifier ) pre: n.canResolve(self.namingContext) post: self.member->includes(n.resolve(self.namingContext)) ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 21
  • 22. Merging ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 22
  • 23. A new semantics for Merge It now creates a new group with the result of the merge Side-effect free User-defined merging operation between elements ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 23
  • 24. Conclusions New UML grouping and naming mechanisms Elements can belong to more than one group Elements can have different names in different contexts Pros Backwards compatible with UML (almost) Package is a kind of Group Element names are now derived attributes Import and Merge operations ironed out Side-effects free Clear conflict detection Aligned with existing and mature international standards Cons UML may ignore it… Future work Synonyms, refinement of operation specifications, fine-tuning of constraints (e.g., name+types), tool support for operations UML “redefines”  ECMFA 2011 A. Vallecillo: "Improving Naming and Grouping in UML" 24