Spring 2005 ECE450H1S Software Engineering IITutorial 3More on Design patternsStudy Several Examples of Design PatternsExplain its relation to our course projectsSpring 2005 ECE450H1S Software Engineering IILast lecture…On design patterns• We explained what are patterns, what are design patterns• How are they categorized?• How to apply them?• How to identify them?• How to assess them?Spring 2005 ECE450H1S Software Engineering II1. Design patterns structuresCreational patternsStructural patternsBehavioural patterns2. How are they related to each other?3. Design patterns by examplesSome special design in OpenOME4. Their relation to your course projectToday…Spring 2005 ECE450H1S Software Engineering II1. The GOF Catalogue• CreationalAbstract Factory, Builder, Factory method, Prototype, Singleton• StructuralAdapter, Bridge, Composite, Decorator, Façade, Flyweight, Proxy• BehaviouralChain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, VisitorSpring 2005 ECE450H1S Software Engineering IIBuilderAbstract FactoryFactory methodPrototypeSingletonSpring 2005 ECE450H1S Software Engineering IIAdapterBridgeCompositeDecoratorSpring 2005 ECE450H1S Software Engineering IIFlyweightProxyFaçadeSpring 2005 ECE450H1S Software Engineering IIChain of ResponsibilityCommandInterpreterIteratorSpring 2005 ECE450H1S Software Engineering IIMediatorMementoObserver StateSpring 2005 ECE450H1S Software Engineering IIStrategy•Template Method•VisitorSpring 2005 ECE450H1S Software Engineering II2. Relation among patternsLadan Tahvildari and Kostas Kontogiannis. “On the Role of Design Patterns in Quality-Driven Re-engineering”Spring 2005 ECE450H1S Software Engineering IIA layered versionSpring 2005 ECE450H1S Software Engineering II3. Some Special design patterns in our legacy software1. MVC patternsclassic design pattern from SmallTalkMost editors follows the pattern2. Plugin patternsOpenOME, Protégé, Eclipse3. Meta-modelling patternsTelos, EMF, UML, ProtégéSpring 2005 ECE450H1S Software Engineering II3.1 MVCSpring 2005 ECE450H1S Software Engineering II3.2 Plugin patternsAbstractPluginattribute<<abstract>> plugin_method()ConcretePluginattribute = valueplugin_method()Extension SubSystemSystemSpring 2005 ECE450H1S Software Engineering II3.2.1 OpenOME• AbstractPluginMethod.java– PluginMethod.java• OMEPlugin.java– OMEDefaultPlugin.javaA bunch of methods– Extended by …• edu.toronto.cs.ome.plugins– ERPlugin.java– NFRPlugin.java– IStarPlugin.java– …• Plugin is selected at run-time, depending on the inputclass.ForName( … )Spring 2005 ECE450H1S Software Engineering II3.2.2 Protégé• ClsWidget, ExportPlugin, ImportPlugin, ProjectPlugin, SlotWidget, TabWidget, Widget• Plugins are packaged into a JAR file, under the “plugins” subdirectory• OMETab.java is a TabWidget pluginpackaged as plugins/edu.toronto.cs.ome/OpenOME.jarSpring 2005 ECE450H1S Software Engineering II3.2.3 Eclipsehttp://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.htmlAnd many articles on its plugin developments … plugin.xml, feature.xmlSpring 2005 ECE450H1S Software Engineering II4. Think about these …• How would you classify the classes in edu.toronto.cs.ome.OME into the MVC pattern?• Which design pattern is used by Web-Service projects?• Which basic design patterns are used by the aforementioned Plugin patterns?Spring 2005 ECE450H1S Software Engineering II5. Relation to your project• Opportunities: – You may add junit test cases to the code base to reveal bugs (publish it to the bug tracking system) and fix them (+5%)– You may apply design patterns, refactoringtechniques on this legacy code base, showing as an improved complexity metrics (+2.5%)– You may tune the performance of the system to speed up the display, load/save for scalable graphs (+2.5%)• Don’t forget your major project task (up to 100%!)– To study the editor methods in the OpenOME and adapt them to the OmniGraphEditor web
View Full Document