-
Book Overview & Buying
-
Table Of Contents
Scala Design Patterns
By :
Whenever we are building libraries or big systems, we quite often depend on other libraries and functionality. Implementing methods sometimes requires the use of multiple classes at the same time. This requires knowledge. Whenever we build a library for someone, we usually try and make it simpler for the users by assuming they do not have (and do not need) as extensive knowledge as we do. Additionally, developers make sure that components are easy to use throughout their application. This is where the facade design pattern can become useful.
Its purpose is to wrap a complex system with a simpler interface in order to hide the usage complexities and ease the client interaction.
We already looked at other design patterns based on wrapping. While the adapter design pattern transforms one interface to another and the decorator adds extra functionality, the facade makes things simpler.
For the class diagram, let's imagine the following setting: we want...
Change the font size
Change margin width
Change background colour