zoukankan      html  css  js  c++  java
  • facade 对于有很多接口的提供一个简单的接口

    Function:   

          A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can:

    • make a software library easier to use and understand, since the facade has convenient methods for common tasks;
    • make code that uses the library more readable, for the same reason;
    • reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system;
    • wrap a poorly-designed collection of APIs with a single well-designed API (as per task needs).

          An Adapter is used when the wrapper must respect a particular interface and must support a polymorphic behavior. On the other hand, a facade is used when one wants an easier or simpler interface to work with.

    Actors:
          Facade, many other objects

    Summary:
          put many other objects into a new class and then provide a method for service.
          

  • 相关阅读:
    matplotlib
    Scipy-数值计算库
    Django Templates
    Django Views: Dynamic Content
    Django Views and URLconfs
    Opencv读写文件
    Logistic回归
    demo
    【Python62--scrapy爬虫框架】
    【Python58--正则2】
  • 原文地址:https://www.cnblogs.com/kevinge/p/1546307.html
Copyright © 2011-2022 走看看