Open SriousTaken opened 6 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.
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.