Saturday, October 19, 2019
Design Patterns Research Paper Example | Topics and Well Written Essays - 1000 words
Design Patterns - Research Paper Example This notification can encompass particular information and facts regarding the topic of the notification. However, the subject can eliminate any of the observers from the list when there is no need for a specific observer to be informed regarding these events or changes with respect to the matter they are registered with the subject. They are used when there is need maintaining constancy and reliability between connected objects while not affecting coupling characteristics of classes. For instance, these patterns can be used when an object needs to be able to inform other objects without having suppositions on the subject of those objects. Moreover, the observer pattern consists of the following elements (Osmani, 2012): Subject: This component is responsible for managing the operation related to observers, such as facilitating, eliminating, or adding observers into the list (Osmani, 2012). Observer: This component is responsible for offering an up to date interface for observers that need to be informed regarding any change (Osmani, 2012). Concrete Subject: This component is responsible for managing transmission and notifications to objects regarding changes to state. It also maintains the state of ConcreteObservers (Osmani, 2012). ConcreteObserver: This component is responsible for establishing and maintaining a reference to the ConcreteSubject. In addition, it also implements a modern interface for the observer to make sure that state is compatible with the subject (Osmani, 2012). Advantages The observer patterns allow software development teams to think effectively about the associations among various elements of software application (Osmani, 2012; Toal, 2012). These patterns also allow software engineers to recognize what application layers have straight associations which could be alternatively replaced with a set of observers and subjects. In this scenario, these patterns can be effectively employed for splitting a software application into a number of sm aller, more freely joined components with the purpose of improving code maintenance as well as competency for re-use (Osmani, 2012; Sud, 2013). These patterns are useful for establishing and maintaining a one-to-many dependency between objects (Marakana Inc., 2013). These patterns provide an excellent communication mechanism for instance, when there is a change in the state all the related objects are notified automatically (Marakana Inc., 2013) Disadvantages As discussed above, these patterns support for decoupling however by decoupling various objects, it can frequently turn out to be hard to get assurance that specific components of a software application are working as they are expected to do (Osmani, 2012; Pierry, 2013). It is believed that in these patterns subscribers are relatively unaware of the subsistence of each other as well as are sightless to the price of switching publishers. Hence, because of this dynamic association between objects, it is difficult to track the upd ate dependence (Osmani, 2012; Sud, 2013). 2. The Factory Pattern The Factory pattern is also one of the most important creational patterns, which is concerned with the concept of developing objects. However, it differentiates with other patterns of the base of a property and that is it doesn't openly require software engineers to make use of use of a constructor. On the other hand, a Factory provides software engineers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.