QUESTION 1
(a) Portray for a split second the four essential elements of a design pattern.
(b) What are factories accountable for and what is the necessary reason to use a factory method?
(c) Factory Method and Abstract Factory design patterns are quite similar. How are they comparable and how are they diverse?
(d) What are two general profits and two dangers of the use of patterns?
(e) What is the objective of the Singleton pattern?
(f) The Singleton uses a special process to instantiate objects. What is special about this process?
(g) What does Alexander means by the following declaration "But it is impossible to form anything which has the temperament of nature by adding preformed parts."
(h) What is an anti-pattern?
QUESTION 2
(a) Express a situation where the Iterator pattern is more appropriate.
(b) Demonstrate the configuration of an Iterator pattern.
(c) What are the dissimilar participants in the Iterator pattern?
(d) Provide four implementation concerns concerning the iterator.
(e)What are the two motivations behind an Iterator?
QUESTION 3
(a) Elucidate how the following patterns could be used in a Library System?
i) Singleton
ii) Template
iii) Decorator
iv) Façade
Your counters should include the structure or sample code of the pattern, description of the pattern in the context of a Library System and justification.
(b) Do you consider that your entire problem can always be clear in terms of patterns?
(c) Is exquisiteness truly in the eye of the beholder or would people agree that some things are beautiful and some are not?
What does Alexander means by this declaration?