Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift 2 Design Patterns

You're reading from   Swift 2 Design Patterns Build robust and scalable iOS and Mac OS X game applications

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781785887611
Length 224 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Julien Lange Julien Lange
Author Profile Icon Julien Lange
Julien Lange
Arrow right icon
View More author details
Toc

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image