that should be the best understanding of a design pattern. The principle of object-oriented language is that everything is an object, but if you really use it, sometimes the number of objects may seem very large, for example, word processing software, if each text as an object, thousands of words, the number of objects is thousands of, no doubt consumes memory, then we still want to "disagree", Find out what these object groups have in common, design a meta-class, encapsulate the classes that can be shared, and, in addition, some features that depend on the application (context), are not shareable, This is the flyweight of two important concepts-internal state intrinsic and external state extrinsic. White point, is to pinch a primitive model, and then with different circumstances and environment, and then produce each characteristic of the concrete model, it is obvious that here need to produce different new objects, so flyweight pattern often appear Factory mode. The internal state of the Flyweight is used for sharing, and Flyweight factory is responsible for maintaining an object that has a Flyweight pool (pattern pools) to hold the internal state. Flyweight mode is a mode to improve the efficiency and performance of the program, which will greatly speed up the operation of the program. There are many applications: for example, if you want to read a series of strings from a database, many of which are duplicates, then we can store these strings in the flyweight pool. Very simple, detailed code see: http://www.cnblogs.com/cxjchen/p/3194379.html
Flyweight mode (Hengyuan mode)