"Design Model Design Pattern" reading notes

xiaoxiao2021-03-06  15

"Design Model Design Pattern" reading notes

Bridge mode

Alias

Handle / Body

structure

purpose

A bridge is created between the interface / Abstract and Implementation. Thus,

1. It is easy to provide different implementations for the interface

2, the interface can be easily expanded (derived) and is not related to the specific implementation

Contact and differences with other modes

1, Abstract Factory can be used to create Bridge

AbstractProduct ß -------- à Implementor

2, the difference between Bridge and Adapter

The main purpose of Adapter is to utilize an existing implementation. The purpose of Bridge is to provide different implementations for one (possible extension) interface.

Reference

"Design Pattern" Gang-Of-4 1997

转载请注明原文地址:https://www.9cbs.com/read-46609.html

New Post(0)