Eden-06 / FRaMED-2.0

FRaMED 2.0 is the reimplementation of the Full-fledged Role Modeling EDitor allowing the graphical specification of Role-based Software Systems by means of compartments (aka. contexts), objects, roles, and relationships.
Eclipse Public License 2.0
3 stars 0 forks source link

Using the variable "modelType" in pattern consistently #17

Open SriousTaken opened 6 years ago

SriousTaken commented 6 years ago

In graphiti pattern the iorm type is often referenced as Type. ... The iorm type for a pattern is once initialized at it constructor. Whatever this variable "modelType" is not used consistently in the pattern.

SriousTaken commented 4 years ago

Example: Compartment Type Pattern

In the constructor of the class the variable modelType is defined:

public CompartmentTypePattern() {
        super();
        ...
        modelType = Type.COMPARTMENT_TYPE;
        ...
    }

This variable should be used when ever it makes sense. However in discussed class in the operation create you find the following code:

@Override
public Object[] create(ICreateContext createContext) {
   ...
   newCompartmentType.setType(Type.COMPARTMENT_TYPE);
  ...
}

Explanation: The code "Type.COMPARTMENT_TYPE" should be replaced by the class attribute modelType.

zointblackbriar commented 4 years ago

Type members are static members. When we try to reach with the modelType (object) class attribut, we need to change static types to object members. All members that relevant to COMPARTMENT_TYPE are also static, hence it can create an object immutability issue. There are no tests that check multi-thread issues. So leave as it is.