11
Wrapper are classes whose features they expose are implemented elsewhere.
It is common in C# for example to create Wrappers classes to expose features of the Win32 API that are embedded in the Framework. NET through the functionality called Pinvoke.
You can also have Wrappers that expose functionality from other libraries and this happens a lot in PHP. An example is the phpGTK library that contains several Wrapper classes from the native library.
It is recommended to use Wrappers classes when you need to integrate functionality from external libraries/runtimes/languages you are using because they provide you with a native interface to your language for your code clients. Also concentrating on one place only the possible maintenance you will need to perform if a new version of the external library is incompatible with the integration that has been performed.
This question is not too general?
– C. E. Gesser
It’s literally one class that wraps another.
– Paulo Morgado