I. Classification of design Patterns
Overall, 23 design patterns fall into three broad categories:
Create five types of models: Factory method mode, abstract Factory mode, singleton mode, builder mode, prototype mode.
Structure mode, a total of seven kinds: Adapter mode, adorner mode, proxy mode, appearance mode, bridging mode, combined mode, enjoy the meta-mode.
There are 11 types of behavioral Patterns: Strategy mode, template method mode, observer mode, iteration sub-mode, responsibility chain mode, Command mode, Memo mode, state mode, visitor mode, mediator mode, interpreter mode.
In fact, there are two types: concurrency mode and thread pool mode.
II. Eight design patterns common in Android
In general, there are eight common design patterns: Singleton, factory, observer, Agent, command, adapter, composition, visitor
Singleton mode: In order to make the system only one call object, the disadvantage is that the singleton makes the other program rely on it excessively, and the different singleton runs in the different process, makes the maintenance difficult;
Factory mode: The production of some fixed things, such as abstract class, the disadvantage is the product modification trouble; If the person likes action movies and love movies to send the same request to the server, they can get the movie set that they want to see, which is equal to the same request from different objects, and needs are satisfied.
Observer pattern: A object is monitored by multiple objects, such as a cache;
Proxy mode: Your own things to others to do, the results can be returned, such as asynchronous threads;
Command mode: Separates the calling object from the object, and the middleware coordinates the work between the two, such as the controller;
Adapter mode: Turns an interface into a user-required interface, such as Baseadapter can be adapted to the ListView and spinner, because they have the same interface
Compositing mode: Converts a one-to-many relationship into a pair of whole relationships, such as a ListView and adapter;
Visitor pattern: Take different treatments for different objects, such as instanceof.
Android Development Design Model series of brocade, very good an article recommended to everyone.
Http://mobile.51cto.com/android-419145.htm
Design Patterns in Android