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

redundant code for finding shape children and connection decorators #7

Open SriousTaken opened 6 years ago

SriousTaken commented 6 years ago

In many classes there is a need of finding specific shape children or connection decorators of a connection. This is often solved with a really similiar for loop. With using one or two operations in the utility classes ConnectionPatternUtil and ShapePatternUtil this could be easily avoided.

SriousTaken commented 4 years ago

Example: Class DataTypePattern, operation update:

for(Shape shape : containerShape.getChildren()) {
   ...
   if(UIUtil.isShape_IdValue(shape, literals.SHAPE_ID_DATATYPE_NAME)) {
      text.setValue(businessTypeName);
      returnValue = true;
}   }

Similiar code like the one in the example is used in many classes and could be extracted to a more general util function which can be called when needed to reduce redundant code.