III
BASIC PATTERNS

The patterns discussed in this section are some of the most common, basic and important design patterns one can find in the areas of object-oriented design and programming. Some of these fundamental design patterns, such as the Interface, Abstract Parent, Private Methods, etc., are used extensively during the discussion of the other patterns in this book.

Chapter Pattern Name Description
3 Interface Can be used to design a set of service provider classes that offer the same service so that a client object can use different classes of service provider objects in a seamless manner without having to alter the client implementation.
4 Abstract Parent Class Useful for designing a framework for the consistent implementation of the functionality common to a set of related classes.
5 Private Methods Provide a way of designing a class behavior so that external objects are not permitted to access the behavior that is meant only for the internal use.
6 Accessor Methods Provide a way of accessing an object’s state using specific methods. This approach discourages different client objects from directly accessing the attributes of an object, resulting in a more maintainable class structure.
7 Constant Data Manager Useful for designing an easy to maintain, centralized repository for the constant data in an application.
8 Immutable Object Used to ensure that the state of an object cannot be changed. May be used to ensure that the concurrent access to a data object by several client objects does not result in race conditions.
9 Monitor A way of designing an application object so that it does not produce unpredictable results when more than one thread tries to access the object at the same time in a multithreaded environment.

The Java programming language has built-in support for some of the fundamental design patterns in the form of language features. The other fundamental patterns can very easily be implemented using the Java language constructs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.95.7