Identification of Design Patterns with Pattern Matching Algorithms
Identification of Design Patterns with Pattern Matching Algorithms
This page summarises the results of the identification of several design motifs on different systems using a bit-vector algorithm. Comments and questions are welcome!
Below are the strings used to identified the motifs. We described the Observer and State/Strategy design motifs in two different ways to account for different understandings of the solution of these motifs.
| Abstract Factory | ConcreteFactory creation Product dummyRelationship ConcreteFactory association Product dummyRelationship EPI_Abstract_AbstractProduct inheritance Product dummyRelationship EPI_Abstract_AbstractFactory inheritance ConcreteFactory |
| Adapter | EPI_Abstract_Target inheritance Adapter association Adaptee ignorance Adapter dummyRelationship Adaptee ignorance Target ignorance Adaptee |
| Command | Invoker aggregation EPI_Abstract_Command inheritance ConcreteCommand association Receiver ignorance Invoker ignorance ConcreteCommand dummyRelationship Receiver ignorance EPI_Abstract_Command dummyRelationship Receiver ignorance ConcreteCommand |
| Composite | Composite containerComposition EPI_Abstract_Component inheritance Composite dummyRelationship EPI_Abstract_Component inheritance Leaf |
| Decorator | EPI_Abstract_Decorator containerComposition EPI_Abstract_Component inheritance EPI_Abstract_Decorator inheritance ConcreteDecorator dummyRelationship EPI_Abstract_Component inheritance ConcreteComponent |
| Observer (1) | Subject association EPI_Abstract_Observer inheritance ConcreteObserver association Subject dummyRelationship EPI_Abstract_Observer ignorance Subject ignorance ConcreteObserver |
| Observer (2) | EPI_Abstract_Subject association EPI_Abstract_Observer inheritance ConcreteObserver association ConcreteSubject ignorance ConcreteObserver ignorance EPI_Abstract_Subject inheritance ConcreteSubject ignorance EPI_Abstract_Observer ignorance EPI_Abstract_Subject |
| State/Strategy (1) | Context aggregation EPI_Abstract_State inheritance ConcreteStateA dummyRelationship EPI_Abstract_State inheritance ConcreteStateB dummyRelationship EPI_Abstract_State ignorance Context dummyRelationship ConcreteStateA ignorance Context dummyRelationship ConcreteStateB ignorance Context |
| State/Strategy (2) | Context aggregation EPI_Abstract_State inheritance ConcreteState dummyRelationship EPI_Abstract_State ignorance Context dummyRelationship ConcreteState ignorance Context |
Below are the occurrences identified by our algorithm for each motif and each system. (Please note that the computation times reported in the files below have been computed on a different computer than those reported in the article.)
| Juzzle | JUnit | JHotDraw | Trove | QuickUML | Gantt Project | JRefactory | Azureus | |
| Abstract Factory | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ |
| Adapter | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ |
| Command | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ |
| Composite | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ |
| Decorator | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ | ♦ |
| Observer | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 |
| State/Strategy | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 | 1, 2 |