Design Patterns
There are 3 types:
- Creational
- Structural
- Behavior
Adapter Designer
Convert interface into another interface
- The client usually implement an interface
- The interface is not always necessary
- Don't add functinoallity
- Ex.-
- Integer[] array = new Integer[]{1,2,3};
- List<String> list = array.asList();
- Client is the legacy class
- Interface define the behavior for Client class
- LegacyProduct implements Adapter interface but overwrite the methods to return the same as Client
Comentarios
Publicar un comentario