FreeRole anti-pattern

Full name

Free Role Specialization


Logical; Scope


Role; Relator


A «Role» type connected to a «Relator» type through a «Mediation» association, is specialized in one or more «Role» types, which in turn are not connected to an additional «Mediation» association


Identify the condition required for the instantiation of the subtypes of the role that are not connected to any relator, since no particular condition was defined.


The Free Role Specialization (FreeRole) anti-pattern occurs when a «Role» type connected to a «Relator» through a «Mediation» association, is specialized in other «Role» types, which do not directly own an additional «Mediation» association. Every free role must meet the following requirements:

  1. It cannot be directly connected to any mediation.

  2. It cannot be a direct or indirect subtype of a «RoleMixin» that is directly connected to a mediation from a hierarchy path that does not go through DefinedRole.



Refactoring Plans
  1. [OCL] Set derived role as derived: The instantiation of a free role defined by a derivation rule, which can be defined as follows:

    context FreeRole-1 :: allInstances() : Set(FreeRole-1)
    derive : DefinedRole.allInstances()->select( x | <CONDITION>)
  2. [New] Add independent relator: a free role is defined by another relator which has no relation to DefiningRelator. Implies the creation of a relator and a mediation, like in the structure: RefactoringPlanA

  3. [New] Add a redefining material relation: a free role is defined by a redefining material relation, like in the structure: RefactoringPlanB


Prince Sales, Tiago. (2014). Ontology Validation for Managers.