North wind pattern design courses --- 17 bridge mode

North wind pattern design courses --- 17 bridge mode

A summary

Sentence summary:

Not only to learn through video, but also the inside of the introduction of other blog, to explain the search, the role of search, search examples
Design models are abstractions of life, such as user access to equipment, I can start to equip the plant produced equipment, then give these doors arsenal, arsenal were the door to me, if it is Daguai equipment, can be equipped with the factory is equipped to a monster arsenal

 

1, bridge mode applicable scenarios?

Multidimensional: forming a multi-dimensional between models (cars, trucks, cars, etc.) and the engine (2000CC, 2200CC, etc.)

 

2, suitable for multi-dimensional design patterns?

Create a type: the abstract factory pattern
Stereotype: bridging mode

 

3, bridge mode kernel code to achieve?

A combination of car and engine2000: Car car1 = new Bus (engine2000);
Jeep and engine2200 combination of: Car jeep1 = new Jeep (engine2200);

 

4, bridge mode bridge mean what does that mean?

So a combination of different systems (such as vehicle, such as engine engine) are connected by way of bridges: the combination car and engine2000: Car car1 = new Bus (engine2000);

 

 

 

Second, content in summary

1, the directory structure

 

 

2, the code

 

 

 

Reproduced in: https: //www.cnblogs.com/Renyi-Fan/p/11032203.html

Guess you like

Origin blog.csdn.net/weixin_33717117/article/details/93571711