mirror of
https://github.com/eMoflon/TGG-3.0-Prototype.git
synced 2024-06-03 02:31:59 +00:00
55 lines
1,020 B
Plaintext
55 lines
1,020 B
Plaintext
package refactoringcd.constraints
|
|
|
|
import "http://www.eclipse.org/emf/2002/Ecore"
|
|
import "platform:/resource/ClassDiagram/model/classDiagram.ecore"
|
|
|
|
|
|
// Violation
|
|
pattern externalMethodAttributeDependency {
|
|
[=] fromClazz : Clazz {
|
|
[=] -features-> method
|
|
}
|
|
|
|
[=] toClazz : Clazz {
|
|
[=] -features-> attribute
|
|
}
|
|
|
|
[=] method : Method {
|
|
[=] -dependencies->attribute
|
|
}
|
|
[=] attribute : Attribute
|
|
};
|
|
|
|
pattern atLeastOneCommonAttributeDependency {
|
|
[=] clazz : Clazz {
|
|
[=] -features-> method
|
|
[=] -features-> otherMethod
|
|
}
|
|
|
|
[=] method : Method {
|
|
}
|
|
|
|
[=] otherMethod : Method {
|
|
}
|
|
|
|
forbid(atLeastOneCommonAttributeDependencySupport)
|
|
[clazz=clazz, method=method, otherMethod=otherMethod]
|
|
};
|
|
|
|
pattern atLeastOneCommonAttributeDependencySupport {
|
|
[=] clazz : Clazz {
|
|
[=] -features-> method
|
|
[=] -features-> otherMethod
|
|
[=] -features-> attribute
|
|
}
|
|
|
|
[=] method : Method {
|
|
[=] -dependencies->attribute
|
|
}
|
|
|
|
[=] otherMethod : Method {
|
|
[=] -dependencies->attribute
|
|
}
|
|
|
|
[=] attribute : Attribute
|
|
}; |