The adapter pattern
The adapter pattern is used to make one object work with another. Say that we need to integrate two subsystems, but they cannot talk to each other because the interface requirements are not met. In real life, you may have encountered a situation where traveling to a different country is troublesome because the power plugs are not the same. To solve this problem, you would probably bring a universal power adapter, which acts as an intermediary to make your device work with foreign electrical outlets. Similarly, different software can be made to fit with each other by the use of adapters.
As long as the interface for working with a subsystem is clear, then creating an adapter can be a straightforward task. In Julia, we can ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access