Banaras Hindu University -...
Transcript of Banaras Hindu University -...
Banaras Hindu University
A Course on
Software Reuse by Design Patterns and Frameworks
by
Dr. Manjari Gupta Department of Computer Science
Banaras Hindu University
Lecture 11
Essential Frameworks Design Patterns
∗ template methods which are based on ∗ hook methods, which can be ∗ abstract methods, ∗ regular methods, or ∗ template methods.
Framework Methods
Hook Overriding
Template and Hook Methods
∗ Template class -T ∗ Has a template method
∗ Hook class -H ∗ Has a hook method
∗ Class –TH ∗ Has both template and hook methods
Template and hook class
∗ abstract coupling, ∗ recursive structures,
metapatterns [Pree94]
∗ three sorts of patterns ∗ patterns relying on abstract coupling, ∗ patterns based on recursive structures, ∗ and other patterns, i.e patterns that do not make use
of the above techniques.
existing design patterns
Abstract coupling of class A and abstract class B
A class diagram which enables recursive object structures
∗ abstract coupling ∗ recursive structures ∗ the notion of multiplicity
metapatterns [Pree94]
The unification metapattern
Separation Principle
The 1:1 connection metapattern
The 1:N connection metapattern
Recursive object composition
1:1 recursive connection metapattern Decorator
1:N recursive connection metapattern Composite
1:1 recursive unification metapattern Chain of Responsibility
1:N recursive unification metapattern
Metapatterns