Wolfgang Pree Software Research Lab Univ. of Constance Germany

Size: px
Start display at page:

Download "Wolfgang Pree Software Research Lab Univ. of Constance Germany"

Transcription

1 Marcus Fontoura CS Department Princeton Univ. U.S.A. Wolfgang Pree Software Research Lab Univ. of Constance Germany Bernhard Rumpe Software Engineering Munich Tech. University Germany 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June UML-F Foundations Terminology: frameworks & components Essential framework patterns Goals of UML-F The UML-F Profile Presentation tags How to present a model? Basic modeling tags Basic modeling concepts Essential pattern tags Annotating 5 essential patterns Catalog & domain-specific pattern tags UML-F & adaptation cookbooks 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

2 Case Study: The JUnit testing framework Tool support for UML-F 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Terminology: frameworks & components 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

3 Construction of complex software systems out of reusable software components: 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Framework := A piece of software that is extensible through the callback style of programming application program library routines 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

4 Component := A piece of software with a programming interface Consequences:» frameworks that offer a programming interface are components» module-oriented languages (Modula, Oberon, Ada) and component standards (CORBA, COM, JavaBeans) just offer different ways of defining such programming interfaces 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Essential framework patterns 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

5 Templates and hooks provide insights in the few construction principles of frameworks, i.e., how to keep socalled hot spots/ variation points flexible. Terminology, Part I: Basic framework building blocks provided by OO language concepts:» template method frozen spot» hook method hot spot/variation point Template methods define a complex default behavior which is adjustable by hook methods. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June UML class diagram inheritance CurrencyConverter convert(...) MyCurrConv public class CurrencyConverter {... public void convert(...) { // template method double result, value;... switch (...) { case... :... result= round(value); break; case... :... result= round(value);... }... } public double round(double val) { // hook method... }... } template hook 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

6 Terminology, Part II: template class T := contains the template method hook class H := contains the hook method(s) only a few combinations are possible these combinations form the essential patterns In the CurrencyConverter example, template and hook method are in the same class, i.e., T and H are unified. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Unification: T and H class are unified CurrencyConverter t() h() TH convert(...) MyCurrConv adaptations can only be done by overriding the hook method adaptations require an application restart 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

7 Separation: T and H classes are separated directed association T H t() h() the behavior of a T object can be modified by composition, i.e., by plugging in specific H objects adaptations at run time become feasible 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June CurrencyConverter rpol RoundingPolicy convert(...) hook template DefaultRPol RPol10 RPol100 public void defineroundingpolicy (RoundingPolicy rp) { rpol= rp; } public void convert(...) { double result, value;... result= rpol.round(value);... } 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

8 Catalog entry hook class hook m ethod A bstract Facto ry AbstractFactory CreateProduct() B uilder Builder BuildPart() Command Command Execute() Inte rpre te r AbstractExpression Interpret() Observer Observer Update() Prototype Prototype Clone() S tate State Handle() S trate gy Strategy AlgorithmInterface() 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June H 1 TH T These patterns allow» building of directed graphs of interconnected objects» message forwarding in the object graphs due to a certain structure of the template method The playground of adaptations through composition is enlarged 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

9 Composite, Decorator, and Chain of Responsibility: * H 1 H 1 TH T T (and Unification, Separation are the 5 essential patterns) 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June What is a template method in one context may become a hook method in another context hooks scale up the essential framework construction patterns scale up T T H T H H 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

10 Framework-centered GoF pattern catalog entries apply essential construction principles» entries mainly differ in the semantics of their hooks.» denoting this semantics in the model helps to understand the design & code how to adapt a framework Modeling standard UML 1.3 does not sufficiently support framework/pattern documentation. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Any framework part that applies a Unification or Separation pattern attaches a specific semantics (purpose) to the hook. Often the pattern is named after the hook s purpose. The structure of a framework-centered pattern relies on one of the essential patterns. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

11 Goals of UML-F 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June UML-F provides the notational elements to precisely annotate and document design patterns. UML-F can be used to concisely communicate design. UML-F is itself structured in the spirit of frameworks, i.e., an extensible profile. UML-F comprises a lean, memonic set of notational elements. UML-F relies on the UML standard, that is, UML-F extends UML using existing UML extension mechanisms. The UML-F notational elements should be adequate for being integrated in UML tool environments. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

12 Catalog & domain specific patterns Factory Method Template Observer Command Essential patterns Unification Separation Basic modeling tags Presentation tags «fixed» «adapt-static» «adapt-dyn» δ Λ 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June UML 1.3 provides «stereotypes» and {tag=value} pairs» stereotypes are restricted: no value attached, only one per model element» Tagged value pairs are more flexible and combinable UML-F unifies both in the tag-mechanism, by writing» «tag:5» and {tag=5} interchangeably» «tag» is short for «tag:true»» «tag1,tag2» is OK» Special forms of tags, e.g. instead of «complete:true»» Tags values have types (e.g. Boolean,String,Integer) 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

13 Presentation tags 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Model diagrammatic representation on the paper Are all elements of the model presented in the diagram?» indicates: yes, all are shown» indicates: no, there may be more present in the model att1 att2 A att1 A attribute list may be incomplete A foo1() foo2() foo1() foo2() the class is shown completely operation list is complete nothing is known about A s structure 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

14 Flat and hierarchical representation of the design m1() m2() m3() m1() m2()» Λ (hierarchy-symbol): all elements are shown (expanded or flat version)» δ (delta): only the delta is shown inherited operation list is completely shown don t care S A m4new() overridden or new overridden with super()-call m1() m2() m3() m1() m2() 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June S A m4new() δ m1() m2() m3() A m4new() Λ inherited new/re-defined ops completely shown, but no inherited operations white rectangle: the method is inherited and not redefined gray rectangle: the method is either newly defined, or it is inherited, but completely redefined half gray / half white rectangle: the method is redefined, but uses the inherited method through a super() call don t care rectangle: the diagram does not reveal any information (can actually be either of the above three) 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

15 Basic modeling tags 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Tag name Applies to Value Description «fixed» «adapt-static» «adapt-dyn» «application» «framework» Class, Method, Generalization Interface, Class, Method, Generalization Interface, Class, Method, Generalization Class, Package, Interface Class, Package, Interface Bool Bool Bool Bool Bool The element is fixed. The element can be adapted during design-time through subclassing. The interface, class, method can be changed through dynamic loading of new subclasses during runtime. The element belongs to the application. The element belongs to the framework. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

16 Modeling the Rounding example with the basic UML-F modeling tags «framework» CurrencyConverter +convert() «fixed» «framework» RoundingPolicy +round() «adapt-static» «adapt-static» «application» DefaultRPol +round() «application» +round() RPol10 «application» +round() RPol , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Combining basic modeling and presentation tags «framework»... CurrencyConverter +convert() «fixed» «framework» RoundingPolicy +round() «adapt-static» «adapt-static» «application» δ «application» δ «application» δ DefaultRPol RPol10 RPol100 +round() +round() +round() 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

17 Essential patterns tags 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June The basic modeling tags are rather flexible but are also quite low level» Use them as building blocks for introducing new tags» Patterns usually combine several tags Each new layer of tags is more specific and less flexible» the tags contain more semantic that describes purpose and usage 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

18 The «fixed» method becomes The «adapt-dyn» and «adapt-static» methods The class with the template method The class with the hook method «template» «hook» «template» «hook» A class can be both «template» and «hook»» e.g in the Unification pattern,» or through participation in several pattern identification through pattern names 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Two equivalent representations of the same design - using basic tags and using «template» and «hook» tags «template: s1» A foo() «template: s1» «hook: s1» «template: s2» B bar() «hook: s1» son() «hook: s2» C «hook: s2» ton() «template: s2» «fixed» A «adapt-static» B «adapt-static» C foo() «fixed» bar() «adapt-static» son() «adapt-static» ton() «fixed» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

19 The Rounding example with «template» and «hook» tags «framework» CurrencyConverter +convert() «template» «framework» RoundingPolicy +round() «hook» «adapt-static» «application» DefaultRPol +round() «application» +round() RPol10 «application» +round() RPol , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Define a tags to:» Make the use of the basic framework patterns explicit» Higher level of system documentation gives more compact, yet concise documentation easier to understand The «template» and «hook» tags are the building blocks for the basic framework patterns tags 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

20 Design based on the «template» and «hook» tags Design based on the Unification pattern tags convert(...) «template, hook: Rounding» CurrencyConverter «template: Rounding» «hook: Rounding» «Unif TH: Rounding» CurrencyConverter convert(...) «Unif-t: Rounding» «Unif-h: Rounding» MyCurrConv pattern specific tag as a combination of basic tags 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Design based on the Separation pattern tags «Sep T: RPol» CurrencyConverter «Sep H: RPol» RoundingPolicy convert(...) «Sep t: RPol» «Sep h: RPol» DefaultRPol RPol10 RPol , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

21 The «template» and «hook» tags are also the building blocks for the recursive patterns tag set Composite, Decorator, and Chain of Responsibility: * H 1 H 1 TH T T 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June H h() * Item getsizeinbytes(): long... T Folder TextDoc DrawDoc t() getsizeinbytes(): long additem(i: Item) removeitem(name: String)... getsizeinbytes(): long... getsizeinbytes(): long... long size=0; for each i in items size+= i.getsizeinbytes(); return size; add i to collection of items 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

22 object diagram :DrawDoc :Folder :Folder :TextDoc :TextDoc link object 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Class tags «Composite Component» «Composite Composite» «Composite Leaf» Method tags «Composite op()» «Composite add()» «Composite remove» operation() «template» Composite «template» * «hook» Component operation() «hook» , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

23 Modeling the Item-Folder framework with the Composite pattern tags: * «C Comp: ItemM» Item getsizeinbytes(): long... «C op(): ItemM» «C Composite: ItemM» Folder getsizeinbytes(): long «C op(): ItemM» additem(i: Item) «C add: ItemM» removeitem(name: String) «C remove: ItemM»... «C Leaf» TextDoc getsizeinbytes(): long «C op(): ItemM»... «C Leaf» DrawDoc getsizeinbytes(): long «C op(): ItemM» , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June vobj vobj 1 1 draw()... «D Comp» VObject «D op()-h» «D Decorator: ScrollerD» Scroller draw() «D op()-t: ScrollerD»... «D Decorator: BorderD» BorderItem draw() «D op()-t: BorderD» vobj.draw(); calculate scroll position scroll to position vobj.draw(); draw border draw()... «D ccomp» TextView 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

24 nextconv 1 «COR Handler» Converter if (nextconv) nextconv.convert(...);... convert(file) «COR hreq-fwd» «COR chandler» HTMLConverter... convert(file) «COR hreq»... convert(file) «COR chandler» RTFConverter «COR hreq»... if (can convert )... // do it if (can convert )... // do it 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Catalog & domainspecific pattern tags 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

25 The UML-F tags for the essential patterns already allow the annotation of frameworks on a pattern level In order to express more semantics, additional tags that resemble directly the framework-related patterns in the GoF catalog are helpful Recipe: take the GoF pattern structure => define UML-F tags Domain-specific pattern tags rely on the tags for the essential framework patterns 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June The Strategy pattern tags are defined in terms of the Separation pattern: «Sep-t» = «Strategy-Ctxt» «Sep-h» = «Strategy-S»... «Strategy Ctxt» «Strategy S» CurrencyConverter RoundingPolicy convert(...) «Strategy cint()» «Strategy algoint()» DefaultRPol RPol10 RPol , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

26 «Sep T» Calculator «Sep H» CalcAlgorithm calcop() «Sep tl)» calcalgo() «Sep h()» ConcreteAlgorithm calcalgo() «Calc C» CurrencyConverter «Calc Algo» RoundingPolicy convert(...) «Calc cop()» «Calc calgo()» DefaultRPol RPol10 RPol , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June UML-F & adaptation cookbooks 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

27 A cookbook is framework specific It is a textual description of the» framework architecture and design, and» how to apply the framework through its adaptation (collection of Howto -recipes) UML-F diagrams complement cookbooks describing both, the architecture, and giving suggestions, where and which code has to be written by the application developer 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June How to adapt currency converter?» If all the required rounding policies have been defined the adaptation is by composition only» If a rounding policy still has to be defined: Subclass RoundingPolicy Override round() 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

28 The «fixed» generalization indicates the adaptation by composition principle no new classes are added «framework» CurrencyConverter +convert() «fixed» «framework» RoundingPolicy +round() «adapt-static» «fixed» «application» DefaultRPol +round() «application» +round() RPol10 «application» +round() RPol , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June The «application» and «adapt-static» tags indicate where the code should be added The symbol indicates that the only method that has to be defined in the application classes is round() «framework»... CurrencyConverter +convert() «fixed» «framework» RoundingPolicy +round() «adapt-static» «adapt-static» «application» δ NewClass +round() 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

29 Use the cookbook recipes for the basic framework patterns to define new ones The UML-F tags provide the mapping How to adapt currency converter (Separation)?» If all the required (concrete Sep-h classes) rounding policies have been defined the adaptation is black-box» If a rounding policy (concrete Sep-h class) still has to be defined: Subclass RoundingPolicy (Sep-h) Override round() (Sep-h()) 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June The JUnit testing framework 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

30 Adding new test cases: JUnit provides a standard interface for defining test cases and allows the reuse of common code among related test cases. Tests suites: Framework users can group test cases in test suites. Reporting test results: the framework keeps flexible how test results are reported. The possibilities include storing the results of the tests in a database for project control purposes, creating HTML files that report the test activities. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Overview of the JUnit design - Class ComplexTest defines test cases for complex numbers «framework» Test composition (form of association) «framework» TestSuite «framework» TestCase «framework» TestResult «application» ComplexTest 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

31 The initialization part is responsible for creating the text fixture. The test itself uses the objects created by the initialization part and performs the actions required for the test. Finally, the third part cleans up a test. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June The TestCase design is based on the Template Method design pattern - method run() controls the test execution «TemplateM-AbstractClass» TestCase +run() «TemplateM-templateM()» #setup() «TemplateM-primitiveOp()» #runtest() «TemplateM-primitiveOp()» #teardown() «TemplateM-primitiveOp()» public void run() { setup(); runtest(); teardown(); } 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

32 TestCases are grouped into TestSuites a variation of the Composite design pattern «interface» «C-Comp» Test +run() «C-op()-h» «fixed» * Black-box adaptation «TemplateM-AbstractClass» «C-Leaf» TestCase «C-Composite» TestSuite +run() «C-op()-t» ftests +run() «TemplateM-templateM()» +addtest(test) «C-add» <<C-op()» #setup() «TemplateM-primitiveOp()» #runtest() «TemplateM-primitiveOp()» #teardown() «TemplateM-primitiveOp()» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Failures are situations where the assert() method does not yield the expected result. Errors are unexpected bugs in the code being tested or in the test cases themselves. The TestResult class is responsible for reporting the failures and errors in different ways. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

33 TestResult must provide four methods: starttest() - initialization code addfailure() - reports a failure adderror() - reports an error endtest() - clean-up code «Strategy-Ctxt» TestCase +run() «Strategy-cInt()» «Strategy-S» TestResult +starttest() «Strategy-algoInt()» +addfailure() «Strategy-algoInt()» +adderror() «Strategy-algoInt()» +endtest() «Strategy-algoInt()» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June (extended) sequence diagram :TestCase :TestResult :error :TestCase :TestResult run() starttest() adderror() setup() call runtest() + (error failure) :failure :TestCase :TestResult choice box teardown() addfailure() timeline endtest() activation 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

34 Cookbook recipes and UML-F diagrams for each of the JUnit variation points» Create a test case (ComplexTest)» Create a test suite (for the ComplexTest methods)» Create an HTML reporting mechanism 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June TestCase adaptation recipe:» Subclass TestCase» Override setup() (optional). The default implementation is empty» Override runtest()» Override teardown() (optional). The default implementation is empty 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

35 TestCaseExample exemplifies the code that has to be added by the application developer White-box adaptation «framework» «TemplateM-AbstractClass» TestCase +run() «TemplateM-templateM()» #setup() «TemplateM-primitiveOp()» #runtest() «TemplateM-primitiveOp()» #teardown() «TemplateM-primitiveOp()» «adapt-static» «application» «TemplateM ConcreteClass» TestCaseExample #setup() «TemplateM-primitiveOp()» #runtest() «TemplateM-primitiveOp()» #teardown() «TemplateM-primitiveOp()» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June «application» Λ «application» Λ TestCaseExample1 TestCaseExample2 For possible adaptation examples, considering the optional hook methods run() «fixed» setup() «fixed» runtest() «fixed» teardown() «fixed» «application» Λ TestCaseExample3 run() «fixed» setup() «fixed» runtest() «fixed» teardown() «fixed» run() «fixed» setup() «fixed» runtest() «fixed» teardown() «fixed» «application» Λ TestCaseExample4 run() «fixed» setup() «fixed» runtest() «fixed» teardown() «fixed» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

36 One aspect in the TestCase class cannot be captured in UML-F design diagrams» Method runtest() takes no parameters as input» Different test cases require different input parameters.» The interface for theses test methods has to be adapted to match runtest(). 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June «framework» «TemplateM-AbstractClass» TestCase «adapt-static» For adapting testexample1(). One inner subclass has to be defined for each test method. The inner subclass overrides runtest() so that the corresponding test method can be invoked with the appropriate parameters. «application» TestCaseExample #setup() #testexample1() «fixed» #testexample2() «fixed» #teardown() «adapt-static» For adapting testexample2() «application» «application» #runtest() «fixed» #runtest() «fixed» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

37 «application» ComplexTest #setup() «fixed» #testadd() «fixed» #testmultiply() «fixed» «fixed» «application» «application» #runtest() «fixed» #runtest() «fixed» public class ComplexTest extends TestCase { private ComplexNumber fonezero; private ComplexNumber fzeroone; private ComplexNumber fminusonezero; private ComplexNumber foneone; protected void setup() { fonezero = new ComplexNumber(1, 0); fzeroone = new ComplexNumber(0, 1); fminusonezero = new ComplexNumber(-1, 0); foneone = new ComplexNumber(1, 1); } public void testadd() { //This test will fail!!! ComplexNumber result = foneone.add(fzeroone); assert(foneone.equals(result)); } public void testmultiply() { ComplexNumber result = fzeroone.multiply(fzeroone) assert(fminusonezero.equals(result)); } 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June «interface» «C-Comp» Test +run() «C-op()-h» «fixed» * Adaptation by overriding the suite() method :TestCase suite() s:testsuite «C-Leaf» TestCase +run() «C-op()» «C-Composite» TestSuite +run() «C-op()-t» +addtest(test) «C-add» ftests s * addtest() +suite() 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

38 TestCase and TestSuite are related variation points public static Test suite() { TestSuite suite = new TestSuite(); suite.addtest(new ComplexTest("testing add") { protected void runtest() { this.testadd(); } } ); suite.addtest(new ComplexTest("testing multiply") { protected void runtest() { this.testmultiply(); } } ); return suite; } 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June «framework» «Strategy-S» TestResult +starttest() «Strategy-algoInt()» +addfailure() «Strategy-algoInt()» +adderror() «Strategy-algoInt()» +endttest() «Strategy-algoInt()» «adapt-static» «application» TestResultExample +starttest() +addfailure() +adderror() +endttest() «application» HTMLTestResult +starttest() «fixed» +addfailure() «fixed» +adderror() «fixed» +endtest() «fixed» print the number of tests executed so far and closes the file create the HTML file report the failure by appending a line to the HTML file report the error by appending a line to the HTML file 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

39 Display of a sample HTML file that reports a failure. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Pattern-annotated diagram for the main JUnit classes Composite: Component Test +run() #setup() Template Method #runtest() #teardown() * Composite: Leaf +run() TestCase +run() TestSuite +addtest() ftests Composite 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

40 Tool support for UML-F 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June «Strategy-Ctxt» TestCase +run() «Strategy-cInt()» «Strategy-S» TestResult +starttest() «Strategy-algoInt()» +addfailure() «Strategy-algoInt()» +adderror() «Strategy-algoInt()» +endtest() «Strategy-algoInt()» «Sep-T» TestCase «Sep-H» TestResult +run() «Sep-t» +starttest() «Sep-h» +addfailure() «Sep-h» +adderror() «Sep-h» +endtest() «Sep-h» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

41 A single class participates in several design patterns This is a common situation that may lead to a polluted design «TemplateM-AbstractClass» «C-Leaf» «Strategy-Ctxt» TestCase +run() «TemplateM-templateM()» <<C-op()» «Strategy-cInt()» #setup() «TemplateM-primitiveOp()» #runtest() «TemplateM-primitiveOp()» #teardown() «TemplateM-primitiveOp()» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Use of design incompleteness presentation tags for slicing the design «TemplateM-AbstractClass» «C-Leaf» «Strategy-Ctxt» TestCase +run() «TemplateM-templateM()» <<C-op()» «Strategy-cInt()» #setup() «TemplateM-primitiveOp()» #runtest() «TemplateM-primitiveOp()» #teardown() «TemplateM-primitiveOp()» To the Template Method To the Composite To the Strategy 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

42 «framework» «Strategy-S» TestResult +starttest() «Strategy-algoInt()» +addfailure() «Strategy-algoInt()» +adderror() «Strategy-algoInt()» +endttest() «Strategy-algoInt()» «adapt-static» «application» TestResultExample +starttest() +addfailure() +adderror() +endtest() «application» HTMLTestResult +starttest() «fixed» +addfailure() «fixed» +adderror() «fixed» +endtest() «fixed» 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Bibliography 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

43 UML-F Web-site: Fontoura M., Pree W., Rumpe B. (2000) The UML Profile for Framework Architectures, Addison- Wesley. Beck K. (1999). extreme Programming explained, Addison-Wesley Beck K. and Gamma E. (1998a). JUnit: A Cook s Tour (ftp:// Beck K. and Gamma E. (1998b). Test Infected: Programmers Love Writing Tests, Java Report, 3(7) Boehm B. (1994). Megaprogramming. Video tape by University Video Communications ( Stanford, California Booch G. (1994). Object-Oriented Analysis and Design with Applications. Redwood City, CA: Benjamin/Cummings Booch G., Rumbaugh J., Jacobson I. (1998) The Unified Modeling Language User Guide. Reading, Massachusetts: Addison-Wesley Coad P. (1992). Object-oriented patterns. Communications of the ACM, 33(9) D Souza D., Wills A. (1998) Objects, Components, and Frameworks with UML. Reading, Massachusetts: Addison- Wesley D Souza D., Sane A., Birchenough A. (1999) First-Class Extensibility for UML Packaging of Profiles, Stereotypes, Patterns. In: «UML» 99 The Unified Modeling Language. Conference Proceedings. Eds: R. France, B. Rumpe. Springer Verlag. LNCS , M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June Fayad M., Schmidt D., Johnson R. (1999) Building Application Frameworks: Object-Oriented Foundations of Framework Design, Wiley Fayad M., Schmidt D., Johnson R. (1999) Implementing Application Frameworks: Object-Oriented Frameworks at Work, Wiley Fayad M., Schmidt D., Johnson R. (1999) Domain-Specific Application Frameworks: Manufacturing, Networking, Distributed Systems, and Software Development, Wiley Gamma E., Helm R., Johnson R. and Vlissides J. (1995) Design Patterns Elements of Reusable OO Software. Reading, MA: Addison-Wesley (also available as CD) Jacobson I., Booch G., Rumbaugh J., (1999) The Unified Software Development Process. Reading, Massachusetts: Addison-Wesley Johnson R. (1992). Documenting Frameworks Using Patterns, ACM Conference on Object-Oriented Programming, Systems, Languages and Applications 1992 Krasner G. and Pope S. (1998). A Cookbook for Using the Model-View-Controller User Interface Paradigm in Smalltalk-80, Journal of Object-Oriented Programming, 1(3) Pree W. (1995) Design Patterns for Object-Oriented Software Development. Reading, Massachusetts: Addison- Wesley/ACM Press Rumbaugh J., Jacobson I., Booch G., (1998) The Unified Modeling Language Reference Manual. Reading, Massachusetts: Addison-Wesley Szyperski C. (1998) Component Software Beyond Object-Oriented Programming, Addison-Wesley. 2000, M. Fontoura, W. Pree, B. Rumpe TE, Mont Saint-Michel, June

The UML Profile for Framework Architectures

The UML Profile for Framework Architectures Context (I) he UML Profile for Framework rchitectures Marcus Fontoura CS Department Princeton Univ. U.S.. mfontoura@acm.org Wolfgang Pree Software Research Lab Univ. of Constance Germany pree@acm.org Bernhard

More information

Product Line Annotations with UML-F

Product Line Annotations with UML-F Product Line Annotations with UML-F Wolfgang Pree 1, Marcus Fontoura 2, and Bernhard Rumpe 3 1 Department of Computer Sciences (guest), Univ. of California, Berkeley, pree@eecs.berkeley.edu 2 IBM Almaden

More information

Product line annotations with UML-F

Product line annotations with UML-F Product line annotations with UML-F Wolfgang Pree 1), Marcus Fontoura 2), Bernhard Rumpe 3) 1) Department of Computer Sciences, University of California, Berkeley 2) IBM Almaden Research Center, San Jose,

More information

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015 xtreme Programming (summary of Kent Beck s XP book) 1 Contents The software development problem The XP solution The JUnit testing framework 2 The Software Development Problem 3 Risk Examples delivery schedule

More information

The WebShop E-Commerce Framework

The WebShop E-Commerce Framework The WebShop E-Commerce Framework Marcus Fontoura IBM Almaden Research Center 650 Harry Road, San Jose, CA 95120, U.S.A. e-mail: fontouraalmaden.ibm.com Wolfgang Pree Professor of Computer Science Software

More information

JOURNAL OF OBJECT TECHNOLOGY Online at Published by ETH Zurich, Chair of Software Engineering. JOT, 2002

JOURNAL OF OBJECT TECHNOLOGY Online at  Published by ETH Zurich, Chair of Software Engineering. JOT, 2002 JOURNAL OF OBJECT TECHNOLOGY Online at www.jot.fm. Published by ETH Zurich, Chair of Software Engineering. JOT, 2002 Vol. 1, No. 2, July-August 2002 Representing Design Patterns and Frameworks in UML Towards

More information

Object-Oriented Design Patterns

Object-Oriented Design Patterns Object-Oriented Design Patterns Wolfgang Pree Applied Computer Science University of Constance, D-78457 Constance, Germany Voice: +49-7531-88-44-33; Fax: +49-7531-88-35-77 E-mail: pree@acm.org Abstract.

More information

JUnit: The Goals of JUnit

JUnit: The Goals of JUnit JUnit Cook s s Tour CSIE Department, NTUT Woei-Kae Chen 1 JUnit: The Goals of JUnit To write a framework within which we have some glimmer of hope that developers will actually write tests. The framework

More information

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Today we are going to talk about an important aspect of design that is reusability of design. How much our old design

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 20: GoF Design Patterns Creational 1 Software Patterns Software Patterns support reuse of software architecture and design. Patterns capture the static

More information

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D. Software Design Patterns Jonathan I. Maletic, Ph.D. Department of Computer Science Kent State University J. Maletic 1 Background 1 Search for recurring successful designs emergent designs from practice

More information

Patterns for polymorphic operations

Patterns for polymorphic operations Patterns for polymorphic operations Three small object structural patterns for dealing with polymorphism Alexander A. Horoshilov hor@epsylontech.com Abstract Polymorphism is one of the main elements of

More information

Reuse at Design Level: Design Patterns

Reuse at Design Level: Design Patterns Reuse at Design Level: Design Patterns CS 617- Lecture 17 Mon. 17 March 2008 3:30-5:00 pm Rushikesh K. Joshi Department of Computer Sc. & Engg. Indian Institute of Technology, Bombay Mumbai - 400 076 Reuse

More information

Patterns. Erich Gamma Richard Helm Ralph Johnson John Vlissides

Patterns. Erich Gamma Richard Helm Ralph Johnson John Vlissides Patterns Patterns Pattern-based engineering: in the field of (building) architecting and other disciplines from 1960 s Some software engineers also started to use the concepts Become widely known in SE

More information

Frameworks Representations & Perspectives Position Paper Workshop on Language Support for Design Patterns and Frameworks, ECOOP 97

Frameworks Representations & Perspectives Position Paper Workshop on Language Support for Design Patterns and Frameworks, ECOOP 97 Frameworks Representations & Perspectives Position Paper Workshop on Language Support for Design Patterns and Frameworks, ECOOP 97 Palle Nowack Department of Computer Science, Aalborg University Fredrik

More information

Information systems modelling UML and service description languages

Information systems modelling UML and service description languages Internet Engineering Tomasz Babczyński, Zofia Kruczkiewicz Tomasz Kubik Information systems modelling UML and service description languages Overview of design patterns for supporting information systems

More information

2. Reasons for implementing clos-unit

2. Reasons for implementing clos-unit A CLOS Implementation of the JUnit Testing Framework Architecture: A Case Study Sandro Pedrazzini Canoo Engineering AG sandro.pedrazzini@canoo.com Abstract There are different reasons why you would like

More information

Software Service Engineering

Software Service Engineering Software Service Engineering Lecture 4: Unified Modeling Language Doctor Guangyu Gao Some contents and notes selected from Fowler, M. UML Distilled, 3rd edition. Addison-Wesley Unified Modeling Language

More information

Extending UML to Improve the Representation of Design Patterns

Extending UML to Improve the Representation of Design Patterns Extending UML to Improve the Representation of Design Patterns Marcus Fontoura and Carlos Lucena Software Engineering Laboratory (LES) Computer Science Department, Pontifical Catholic University of Rio

More information

Lecture 17: Case Study: JUnit

Lecture 17: Case Study: JUnit Lecture 17: Case Study: JUnit The JUnit testing framework which you ve been using to test your own code in 6.170 is worth studying in its own right. It was developed by Kent Beck and Erich Gamma. Beck

More information

CS560. Lecture: Design Patterns II Includes slides by E. Gamma et al., 1995

CS560. Lecture: Design Patterns II Includes slides by E. Gamma et al., 1995 CS560 Lecture: Design Patterns II Includes slides by E. Gamma et al., 1995 Classification of GoF Design Pattern Creational Structural Behavioural Factory Method Adapter Interpreter Abstract Factory Bridge

More information

The GoF Design Patterns Reference

The GoF Design Patterns Reference The GoF Design Patterns Reference Version.0 / 0.0.07 / Printed.0.07 Copyright 0-07 wsdesign. All rights reserved. The GoF Design Patterns Reference ii Table of Contents Preface... viii I. Introduction....

More information

Framework Component Systems: Concepts, Design Heuristics, and Perspectives

Framework Component Systems: Concepts, Design Heuristics, and Perspectives Framework Component Systems: Concepts, Design Heuristics, and Perspectives Wolfgang Pree, Gustav Pomberger C. Doppler Laboratory for Software Engineering Johannes Kepler University Linz, A-4040 Linz, Austria

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1 Ingegneria del Software Corso di Laurea in Informatica per il Management Design Patterns part 1 Davide Rossi Dipartimento di Informatica Università di Bologna Pattern Each pattern describes a problem which

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming 1/9 Introduction to Object-Oriented Programming Conception et programmation orientées object, B. Meyer, Eyrolles Object-Oriented Software Engineering, T. C. Lethbridge, R. Laganière, McGraw Hill Design

More information

MVC. Model-View-Controller. Design Patterns. Certain programs reuse the same basic structure or set of ideas

MVC. Model-View-Controller. Design Patterns. Certain programs reuse the same basic structure or set of ideas MVC -- Design Patterns Certain programs reuse the same basic structure or set of ideas These regularly occurring structures have been called Design Patterns Design Patterns Design Patterns: Elements of

More information

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator. Comparative Study In Utilization Of Creational And Structural Design Patterns In Solving Design Problems K.Wseem Abrar M.Tech., Student, Dept. of CSE, Amina Institute of Technology, Shamirpet, Hyderabad

More information

A System of Patterns for Web Navigation

A System of Patterns for Web Navigation A System of Patterns for Web Navigation Mohammed Abul Khayes Akanda and Daniel M. German Department of Computer Science, University of Victoria, Canada maka@alumni.uvic.ca, dmgerman@uvic.ca Abstract. In

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

Using the UML to Describe Design Patterns

Using the UML to Describe Design Patterns Proceedings of the 16 th Annual NACCQ, Palmerston North New Zealand July, 2003 (eds) Mann, S. and Williamson, A. www.naccq.ac.nz Using the UML to Describe Design Patterns ABSTRACT to describe patterns

More information

A Metric of the Relative Abstraction Level of Software Patterns

A Metric of the Relative Abstraction Level of Software Patterns A Metric of the Relative Abstraction Level of Software Patterns Atsuto Kubo 1, Hironori Washizaki 2, and Yoshiaki Fukazawa 1 1 Department of Computer Science, Waseda University, 3-4-1 Okubo, Shinjuku-ku,

More information

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011 Design Patterns Lecture 1 Manuel Mastrofini Systems Engineering and Web Services University of Rome Tor Vergata June 2011 Definition A pattern is a reusable solution to a commonly occurring problem within

More information

Foundations of Software Engineering Design Patterns -- Introduction

Foundations of Software Engineering Design Patterns -- Introduction Foundations of Software Engineering Design Patterns -- Introduction Fall 2016 Department of Computer Science Ben-Gurion university Based on slides of: Nurit Gal-oz, Department of Computer Science Ben-Gurion

More information

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1 What is a Design Pattern? Each pattern Describes a problem which occurs over and over again in our environment,and then describes the core of the problem Novelists, playwrights and other writers rarely

More information

Scenario-based Synthesis of Annotated Class Diagrams in UML

Scenario-based Synthesis of Annotated Class Diagrams in UML Scenario-based Synthesis of Annotated Class Diagrams in UML Petri Selonen and Tarja Systä Tampere University of Technology, Software Systems Laboratory, P.O.Box 553, FIN-33101 Tampere, Finland {pselonen,tsysta}@cs.tut.fi

More information

3 Product Management Anti-Patterns by Thomas Schranz

3 Product Management Anti-Patterns by Thomas Schranz 3 Product Management Anti-Patterns by Thomas Schranz News Read above article, it s good and short! October 30, 2014 2 / 3 News Read above article, it s good and short! Grading: Added explanation about

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming 3/18/14 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014 Object-Oriented

More information

Topics in Object-Oriented Design Patterns

Topics in Object-Oriented Design Patterns Software design Topics in Object-Oriented Design Patterns Material mainly from the book Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; slides originally by Spiros Mancoridis;

More information

Programming Language Constructs as Basis for Software Architectures. Stefan Resmerita, WS2015

Programming Language Constructs as Basis for Software Architectures. Stefan Resmerita, WS2015 Programming Language Constructs as Basis for Software Architectures 1 From individual parts to components In the 50s: Machine/Assembler programs: bound to specific hardware In the 60s-70s: Higher programming

More information

A Metric for Measuring the Abstraction Level of Design Patterns

A Metric for Measuring the Abstraction Level of Design Patterns A Metric for Measuring the Abstraction Level of Design Patterns Atsuto Kubo 1, Hironori Washizaki 2, and Yoshiaki Fukazawa 1 1 Department of Computer Science, Waseda University, 3-4-1 Okubo, Shinjuku-ku,

More information

Design Patterns. "Gang of Four"* Design Patterns. "Gang of Four" Design Patterns. Design Pattern. CS 247: Software Engineering Principles

Design Patterns. Gang of Four* Design Patterns. Gang of Four Design Patterns. Design Pattern. CS 247: Software Engineering Principles CS 247: Software Engineering Principles Design Patterns Reading: Freeman, Robson, Bates, Sierra, Head First Design Patterns, O'Reilly Media, Inc. 2004 Ch Strategy Pattern Ch 7 Adapter and Facade patterns

More information

DESIGN PATTERN MATCHING

DESIGN PATTERN MATCHING PERIODICA POLYTECHNICA SER. EL. ENG. VOL. 47, NO. 3 4, PP. 205 212 (2003) DESIGN PATTERN MATCHING Dániel PETRI and György CSERTÁN Department of Measurement and Information Systems Budapest University of

More information

Compositional Model Based Software Development

Compositional Model Based Software Development Compositional Model Based Software Development Prof. Dr. Bernhard Rumpe http://www.se-rwth.de/ Seite 2 Our Working Groups and Topics Automotive / Robotics Autonomous driving Functional architecture Variability

More information

CS 247: Software Engineering Principles. Design Patterns

CS 247: Software Engineering Principles. Design Patterns CS 247: Software Engineering Principles Design Patterns Reading: Freeman, Robson, Bates, Sierra, Head First Design Patterns, O'Reilly Media, Inc. 2004 Ch 1 Strategy Pattern Ch 7 Adapter and Facade patterns

More information

JUnit A Cook's Tour. Kent Beck and Erich Gamma. Renaat Verbruggen 1#

JUnit A Cook's Tour. Kent Beck and Erich Gamma. Renaat Verbruggen 1# JUnit A Cook's Tour Kent Beck and Erich Gamma Renaat Verbruggen 1# JUnit advice "Whenever you are tempted to type something into a print statement or a debugger expression, write it as a test instead."

More information

Pattern-Oriented Development with Rational Rose

Pattern-Oriented Development with Rational Rose Pattern-Oriented Development with Rational Rose Professor Peter Forbrig, Department of Computer Science, University of Rostock, Germany; Dr. Ralf Laemmel, Department of Information Management and Software

More information

Idioms for Building Software Frameworks in AspectJ

Idioms for Building Software Frameworks in AspectJ Idioms for Building Software Frameworks in AspectJ Stefan Hanenberg 1 and Arno Schmidmeier 2 1 Institute for Computer Science University of Essen, 45117 Essen, Germany shanenbe@cs.uni-essen.de 2 AspectSoft,

More information

Object-Oriented Software Development Goal and Scope

Object-Oriented Software Development Goal and Scope Object-Oriented Software Development Goal and Scope Koichiro Ochimizu Japan Advanced Institute of Science and Technologies School of Information Science Scope and Goal Goal enable you to understand basic

More information

Design patterns. Valentina Presutti courtesy of Paolo Ciancarini

Design patterns. Valentina Presutti courtesy of Paolo Ciancarini Design patterns Valentina Presutti courtesy of Paolo Ciancarini Agenda What are design patterns? Catalogues of patterns Languages of patterns Two case studies: design with patterns Software Architectures

More information

State Pattern supporting both composite States and extension/specialization of State Machines

State Pattern supporting both composite States and extension/specialization of State Machines Pattern supporting both composite s and extension/specialization of Machines BIRGER MØLLER-PEDERSEN, RAGNHILD KOBRO RUNDE, University of Oslo, Norway Most modelling languages support full state machine

More information

Tuesday, October 4. Announcements

Tuesday, October 4. Announcements Tuesday, October 4 Announcements www.singularsource.net Donate to my short story contest UCI Delta Sigma Pi Accepts business and ICS students See Facebook page for details Slide 2 1 Design Patterns Design

More information

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University Idioms and Design Patterns Martin Skogevall IDE, Mälardalen University 2005-04-07 Acronyms Object Oriented Analysis and Design (OOAD) Object Oriented Programming (OOD Software Design Patterns (SDP) Gang

More information

First Steps Towards Conceptual Schema Testing

First Steps Towards Conceptual Schema Testing First Steps Towards Conceptual Schema Testing Albert Tort and Antoni Olivé Universitat Politècnica de Catalunya {atort,olive}@lsi.upc.edu Abstract. Like any software artifact, conceptual schemas of information

More information

Configuration Provider: A Pattern for Configuring Threaded Applications

Configuration Provider: A Pattern for Configuring Threaded Applications Configuration Provider: A Pattern for Configuring Threaded Applications Klaus Meffert 1 and Ilka Philippow 2 Technical University Ilmenau plop@klaus-meffert.de 1, ilka.philippow@tu-ilmena.de 2 Abstract

More information

Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance. 3.1 Introduction... 2

Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance. 3.1 Introduction... 2 Department of Computer Science Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents

More information

Twin A Design Pattern for Modeling Multiple Inheritance

Twin A Design Pattern for Modeling Multiple Inheritance Twin A Design Pattern for Modeling Multiple Inheritance Hanspeter Mössenböck University of Linz, Institute of Practical Computer Science, A-4040 Linz moessenboeck@ssw.uni-linz.ac.at Abstract. We introduce

More information

Using Design Patterns in Java Application Development

Using Design Patterns in Java Application Development Using Design Patterns in Java Application Development ExxonMobil Research & Engineering Co. Clinton, New Jersey Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S.

More information

CHAPTER 6: CREATIONAL DESIGN PATTERNS

CHAPTER 6: CREATIONAL DESIGN PATTERNS CHAPTER 6: CREATIONAL DESIGN PATTERNS SESSION III: BUILDER, PROTOTYPE, SINGLETON Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E. Otero For non-profit

More information

Object-Oriented Software Development Based on Clusters: Concepts, Consequences and Examples

Object-Oriented Software Development Based on Clusters: Concepts, Consequences and Examples Object-Oriented Software Development Based on Clusters: Concepts, Consequences and Examples Wolfgang Pree Institut für Wirtschaftsinformatik, University of Linz A-4040 LINZ, Austria, Europe E-mail: pree@swe.uni-linz.ac.at

More information

Programming Language Constructs as Basis for Software Architectures

Programming Language Constructs as Basis for Software Architectures Programming Language Constructs as Basis for Software Architectures 1 From individual parts to components In the 50s: Machine/Assembler programs: bound to specific hardware In the 60s-70s: Higher programming

More information

UML Specification and Correction of Object-Oriented Anti-patterns

UML Specification and Correction of Object-Oriented Anti-patterns UML Specification and Correction of Object-Oriented Anti-patterns Maria Teresa Llano and Rob Pooley School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh, United Kingdom {mtl4,rjpooley}@hwacuk

More information

4.1 Introduction Programming preliminaries Constructors Destructors An example... 3

4.1 Introduction Programming preliminaries Constructors Destructors An example... 3 Department of Computer Science Tackling Design Patterns Chapter 4: Factory Method design pattern Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 4.1 Introduction.................................

More information

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate UNIT 4 GRASP GRASP: Designing objects with responsibilities Creator Information expert Low Coupling Controller High Cohesion Designing for visibility - Applying GoF design patterns adapter, singleton,

More information

LABORATORY 1 REVISION

LABORATORY 1 REVISION UTCN Computer Science Department Software Design 2012/2013 LABORATORY 1 REVISION ================================================================== I. UML Revision This section focuses on reviewing the

More information

Domain Engineering And Variability In The Reuse-Driven Software Engineering Business.

Domain Engineering And Variability In The Reuse-Driven Software Engineering Business. OBM 7 -draft 09/02/00 1 Domain Engineering And Variability In The Reuse-Driven Software Engineering Business. Martin L. Griss, Laboratory Scientist, Hewlett-Packard Laboratories, Palo Alto, CA. Effective

More information

Design patterns generic models

Design patterns generic models Design patterns generic models Jyothish Maniyath CDC Software India Pvt Ltd 6 th Floor, Canberra Block, UB City, #24 Vittal Mallya Road, Bangalore, India +91 94482 46718 jyosh@maniyath.com ABSTRACT This

More information

Design Patterns. An introduction

Design Patterns. An introduction Design Patterns An introduction Introduction Designing object-oriented software is hard, and designing reusable object-oriented software is even harder. Your design should be specific to the problem at

More information

Design Patterns IV Structural Design Patterns, 1

Design Patterns IV Structural Design Patterns, 1 Structural Design Patterns, 1 COMP2110/2510 Software Design Software Design for SE September 17, 2008 Class Object Department of Computer Science The Australian National University 18.1 1 2 Class Object

More information

CSCI 253. Overview. The Elements of a Design Pattern. George Blankenship 1. Object Oriented Design: Template Method Pattern. George Blankenship

CSCI 253. Overview. The Elements of a Design Pattern. George Blankenship 1. Object Oriented Design: Template Method Pattern. George Blankenship CSCI 253 Object Oriented Design: George Blankenship George Blankenship 1 Creational Patterns Singleton Abstract factory Factory Method Prototype Builder Overview Structural Patterns Composite Façade Proxy

More information

Design Patterns. Gunnar Gotshalks A4-1

Design Patterns. Gunnar Gotshalks A4-1 Design Patterns A4-1 On Design Patterns A design pattern systematically names, explains and evaluates an important and recurring design problem and its solution Good designers know not to solve every problem

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN PATTERN - INTERVIEW QUESTIONS DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions

More information

SDC Design patterns GoF

SDC Design patterns GoF SDC Design patterns GoF Design Patterns The design pattern concept can be viewed as an abstraction of imitating useful parts of other software products. The design pattern is a description of communicating

More information

CSC7203 : Advanced Object Oriented Development. J Paul Gibson, D311. Design Patterns

CSC7203 : Advanced Object Oriented Development. J Paul Gibson, D311. Design Patterns CSC7203 : Advanced Object Oriented Development J Paul Gibson, D311 paul.gibson@telecom-sudparis.eu http://www-public.tem-tsp.eu/~gibson/teaching/csc7203/ Design Patterns /~gibson/teaching/csc7203/csc7203-advancedoo-l2.pdf

More information

Design Patterns Application with MDE

Design Patterns Application with MDE Design Patterns Application with MDE Prof. Jean-Marc Jézéquel (Univ. Rennes 1 & INRIA) Triskell Team @ IRISA Campus de Beaulieu F-35042 Rennes Cedex Tel : +33 299 847 192 Fax : +33 299 847 171 e-mail :

More information

JOURNAL OF OBJECT TECHNOLOGY

JOURNAL OF OBJECT TECHNOLOGY JOURNAL OF OBJECT TECHNOLOGY Online at http://www.jot.fm. Published by ETH Zurich, Chair of Software Engineering JOT, 2006 Vol. 5, No. 8. November-December 2006 Framework Evolution Tool Mariela Cortés,

More information

Object Oriented Paradigm

Object Oriented Paradigm Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 20 GoF Design Patterns Behavioral Department of Computer Engineering Sharif University of Technology 1 GoF Behavioral Patterns Class Class Interpreter: Given a language,

More information

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D Slide 1 Design Patterns Prof. Mirco Tribastone, Ph.D. 22.11.2011 Introduction Slide 2 Basic Idea The same (well-established) schema can be reused as a solution to similar problems. Muster Abstraktion Anwendung

More information

Inheritance and Interfaces

Inheritance and Interfaces Inheritance and Interfaces Object Orientated Programming in Java Benjamin Kenwright Outline Review What is Inheritance? Why we need Inheritance? Syntax, Formatting,.. What is an Interface? Today s Practical

More information

A Novel Approach to Automated Design Pattern Detection

A Novel Approach to Automated Design Pattern Detection A Novel Approach to Automated Design Pattern Detection Nikolaos Tsantalis, Alexander Chatzigeorgiou, Spyros T. Halkidis and George Stephanides Department of Applied Informatics, University of Macedonia,

More information

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible Inheritance EEC 521: Software Engineering Software Design Design Patterns: Decoupling Dependencies 10/15/09 EEC 521: Software Engineering 1 Inheritance is the mechanism by which one class can acquire properties/responsibilities

More information

A Meta-Model for Composition Techniques in Object-Oriented Software Development

A Meta-Model for Composition Techniques in Object-Oriented Software Development A Meta-Model for Composition Techniques in Object-Oriented Software Development Bedir Tekinerdogan Department of Computer Science University of Twente P.O. Box 217, 7500 AE Enschede, The Netherlands E-Mail:

More information

IDERA ER/Studio Software Architect Evaluation Guide. Version 16.5/2016+ Published February 2017

IDERA ER/Studio Software Architect Evaluation Guide. Version 16.5/2016+ Published February 2017 IDERA ER/Studio Software Architect Evaluation Guide Version 16.5/2016+ Published February 2017 2017 IDERA, Inc. All rights reserved. IDERA and the IDERA logo are trademarks or registered trademarks of

More information

James Newkirk

James Newkirk Private Interface Class Structural James Newkirk newkirk@oma.com Intent Provide a mechanism that allows specific classes to use a non-public subset of a class interface without inadvertently increasing

More information

Design Patterns IV. Alexei Khorev. 1 Structural Patterns. Structural Patterns. 2 Adapter Design Patterns IV. Alexei Khorev. Structural Patterns

Design Patterns IV. Alexei Khorev. 1 Structural Patterns. Structural Patterns. 2 Adapter Design Patterns IV. Alexei Khorev. Structural Patterns Structural Design Patterns, 1 1 COMP2110/2510 Software Design Software Design for SE September 17, 2008 2 3 Department of Computer Science The Australian National University 4 18.1 18.2 GoF Structural

More information

WS01/02 - Design Pattern and Software Architecture

WS01/02 - Design Pattern and Software Architecture Design Pattern and Software Architecture: VIII. Conclusion AG Softwaretechnik Raum E 3.165 Tele. 60-3321 hg@upb.de VIII. Conclusion VIII.1 Classifications VIII.2 Common Misconceptions VIII.3 Open Questions

More information

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh SOFTWARE DESIGN COSC 4353 / 6353 Dr. Raj Singh UML - History 2 The Unified Modeling Language (UML) is a general purpose modeling language designed to provide a standard way to visualize the design of a

More information

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8 Object Oriented Methods with UML Introduction to Design Patterns- Lecture 8 Topics(03/05/16) Design Patterns Design Pattern In software engineering, a design pattern is a general repeatable solution to

More information

What is Design Patterns?

What is Design Patterns? Paweł Zajączkowski What is Design Patterns? 1. Design patterns may be said as a set of probable solutions for a particular problem which is tested to work best in certain situations. 2. In other words,

More information

Introduction and History

Introduction and History Pieter van den Hombergh Fontys Hogeschool voor Techniek en Logistiek September 15, 2016 Content /FHTenL September 15, 2016 2/28 The idea is quite old, although rather young in SE. Keep up a roof. /FHTenL

More information

Design patterns. OOD Lecture 6

Design patterns. OOD Lecture 6 Design patterns OOD Lecture 6 Next lecture Monday, Oct 1, at 1:15 pm, in 1311 Remember that the poster sessions are in two days Thursday, Sep 27 1:15 or 3:15 pm (check which with your TA) Room 2244 + 2245

More information

Exam in TDDB84: Design Patterns,

Exam in TDDB84: Design Patterns, Exam in TDDB84: Design Patterns, 2014-10-24 14-18 Information Observe the following, or risk subtraction of points: 1) Write only the answer to one task on one sheet. Use only the front side of the sheets

More information

JUnit 3.8 Documented Using Collaborations

JUnit 3.8 Documented Using Collaborations JUnit 3.8 Documented Using Collaborations Dirk Riehle, dirk@riehle.org, www.riehle.org Abstract This technical report describes the design of the unit testing framework JUnit in its version 3.8. The documentation

More information

Design Patterns. Comp2110 Software Design. Department of Computer Science Australian National University. Second Semester

Design Patterns. Comp2110 Software Design. Department of Computer Science Australian National University. Second Semester Design Patterns Comp2110 Software Design Department of Computer Science Australian National University Second Semester 2005 1 Design Pattern Space Creational patterns Deal with initializing and configuring

More information

Proposal of a Supporting Method for Diagrams Generation with the Transformation Rules in UML

Proposal of a Supporting Method for Diagrams Generation with the Transformation Rules in UML Proposal of a Supporting Method for Diagrams Generation with the Transformation Rules in UML Tetsuro Katayama Department of Computer Science and Systems Engineering, Faculty of Engineering, Miyazaki University

More information

Canica: An IDE for the Java Modeling Language

Canica: An IDE for the Java Modeling Language Canica: An IDE for the Java Modeling Language Angelica B. Perez, Yoonsik Cheon, and Ann Q. Gates TR #06-36 August 2006 Keywords: Integrated development environment, specification tool, programming tool,

More information

APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS

APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS Adem Zumbul (TUBITAK-UEKAE, Kocaeli, Turkey, ademz@uekae.tubitak.gov.tr); Tuna Tugcu (Bogazici University, Istanbul, Turkey, tugcu@boun.edu.tr) ABSTRACT

More information

A MULTI-LEVEL DESIGN PATTERN FOR EMBEDDED SOFTWARE *

A MULTI-LEVEL DESIGN PATTERN FOR EMBEDDED SOFTWARE * A MULTI-LEVEL DESIGN PATTERN FOR EMBEDDED SOFTWARE * Ricardo J. Machado and João M. Fernandes Dept. Sistemas de Informação & Dept. Informática, Universidade do Minho, Portugal Abstract: It is a common

More information

Design Patterns. Produced by. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

Design Patterns. Produced by. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology Design Patterns Produced by Eamonn de Leastar edeleastar@wit.ie Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie Template Method Design

More information