Summary

We discussed the three structural patterns in this chapter: the decorator pattern, the proxy pattern, and the bridge pattern. From a high-level perspective, all of them help you extend classes without using inheritance, but using a dynamic composition of its class hierarchy.

Extending our original class has some impact on our original object except for the proxy pattern where it remains completely unchanged. The decorator pattern that needs to be designed needs to have the original class already developed because every concrete decorator needs to implement an interface based on the original object structure. The bridge pattern is more closely coupled, and there is an understanding that the original object must incorporate considerable references to the rest of the system.

We also discussed all the patterns that rely on rerouting operations. We learned that the rerouting is always done from the new code back to the original.

It is important to note that in real-time applications, where performance is required, the overhead of the time for rerouting the operations might not be acceptable.

In the next chapter, we will continue our discovery of structural patterns with the composite and flyweight patterns, which can be applied to systems that have huge data objects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset