Design patterns – Adapter

Hello guys,

I’m back with the Adapter pattern.

I’ll just say a few words about it and the rest can be seen on the github page.


  • It is used to add a wrapper over an old class, to simplify the access to the end user, or to link with another class that is expecting different parameters / call different functions.
    function UPDATE(int, bool)
  2. Class INTERFACE
    function UPDATE(struct X)
  3. Class Adapter implements INTERFACE, LEGACY_CLASS
    INTERFACE.UPDATE(struct X) -> interpret X data, sends LEGACY_CLASS.UPDATE(int, bool)


The full code can be found at the following link:

You may also like...

Leave a Reply