June 2018
Intermediate to advanced
280 pages
7h 46m
English
The following UML diagram models the interaction between the new client code and the adapted one. The adapter pattern is usually implemented in other languages by using multiple inheritance, which is partially possible starting from Java 8. We will use another approach, which works with older Java versions too; we'll use aggregation. It is more restrictive than inheritance since we are not going to get access to protected content, just the adapter public interface:

We can distinguish between the following actors from the implementation diagram:
Read now
Unlock full access