CSC/ECE 517 Fall 2010/ch7 7e ab

From Expertiza_Wiki
Jump to navigation Jump to search

Protected Variations Pattern

Description

The Protected Variations pattern is a specific example of a GRASP design pattern. Any object that presents a potential instability within the system due to variations of type is implemented with an interface and polymorphism (discussed in chapter 3) is used to wrap the type.[2] The interface could be a small enough to cover only one method or a very broad piece of the total subsystem.[1]

The basic object-oriented programming concepts of data encapsulation, interfaces, and polymorphism are all mechanisms that are similar in nature to the Protected Variations pattern.[3]


Examples

example 1

example 2

•Externalizing properties in a property file is another example of PV.[3]


Advantages

•New implementations can be introduced without affecting clients.3 •Coupling is lowered.3

Protected Variations decouples clients from the changes in the system being used.4

•The impact of cost of changes can be lowered.[3]

•Extensions required for new variations are easy to add.[3]


Disadvantages

References

[1] http://web.cs.wpi.edu/~gpollice/cs4233-a05/CourseNotes/maps/class4/ProtectedVariations.html

[2] http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)#Protected_Variations

[3] http://www.objectsbydesign.com/books/larman_notes/6-DesignAndImplementationTechniques.html

[4] Craig Larman. Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition). Prentice Hall, Upper Saddle River, NJ, 2004


TO BE REMOVED (included for development reference only)

7e. Protected Variations pattern. This is one of the GRASP patterns. Wikipedia: The Protected Variations pattern protects elements from the variations on other elements (objects, systems, subsystems) by wrapping the focus of instability with an interface and using polymorphism to create various implementations of this interface. Describe the pattern, and give examples of its use.


ACM books Authors. Title. Publisher, City of Publication, Year of Publication.


Originality. Chapter is not constructed by copy-and-paste, but rather is the writer's own work. Nor does it duplicate the organization of Wikipedia's article, or any other description of the topic. Rather, it should be presented in a way that differs from each of the sources.

Clarity. The language should be simple and basic. Sentences should be short enough to be understood by a student in this class without rereading. Jargon should be avoided, except for technical terms that are introduced before being used. For a more technical treatment, the reader should be referred to appropriate sources.

Coverage. All relevant material should be discussed, at about the same level of detail. If it is too involved, it is OK to reference external sources, but the entire chapter should not consist of references. Earlier sections should not be covered in more depth than later sections.

Organization. The chapter should begin with an overview suitable for readers who are new to the topic, and proceed from simpler material to more involved. The progression should be logical, and should not jump from one topic to another without transition.

Definitions. Definitions should be clear and concise, and should be supported by explanations or examples. Definitions should be just that--not descriptions. Definitions should should be composed by the author, not taken from other textbooks.

Examples. Examples should be clear, succinct, and unambiguous. Diagrams and realistic examples are encouraged, but diagrams need to be explained with accompanying text.

Citations. All major concepts should have citations to more detailed treatments. Citations should include a good mix of sources, such as Web sites, scientific papers, and books. Citations should be in a common format, such as ACM reference format; do not use just a Web link without any title or author.

Diagrams. If the coverage of this topic would benefit from diagrams, are sufficient diagrams included? Are they easily understandable and well explained?

Flow. Chapters should build on--and reference--earlier chapters. Coverage in this chapter should not duplicate earlier chapters, but use hyperlinks to refer to those earlier sections.

Accuracy. Is the information in this chapter consistent with other descriptions of the same material? Can any errors be identified? Is information purported to be factual indeed a matter of fact rather than opinion?