In this chapter, we have explored several patterns related to reusability. These patterns are highly valuable and can be utilized in many places within an application. In addition, people coming from an object-oriented background will probably find this chapter indispensable when it comes to designing Julia applications.
First, we went into great detail about the delegation pattern, which can be used to create new capabilities and lets us reuse functions from an existing object. The general technique involves defining a new data type that contains a parent object. Then, forwarding functions are defined so that we can reuse the functionalities of the parent object. We learned implementing delegation can be largely simplified by using @forward, which is provided by the Lazy.jl package.
Then, we examined the holy trait pattern, which is a formal way to define the behavior...