Interface pattern
|
In computer science, the interface pattern isn't a specific pattern amongst design patterns. It's a general method for structuring programs so that they're simpler to understand. In general, an interface is a class which provides the programmer with a simpler or more program-specific way of accessing other classes.
An interface could contain a set of objects and provide simpler, higher-level functions to the programmer (for example, the facade pattern); it could provide a cleaner or more specific way of using complicated classes (a "wrapper" class); it could be used to act as "glue" between two different API's (the adapter pattern); and much more.
Other kinds of interface patterns are: delegation pattern, composite pattern, and bridge pattern.zh:接口模式