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
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering Python Design Patterns

You're reading from   Mastering Python Design Patterns Start learning Python programming to a better standard by mastering the art of Python design patterns

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781783989324
Length 212 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
 Kasampalis Kasampalis
Author Profile Icon Kasampalis
Kasampalis
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Mastering Python Design Patterns
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. The Factory Pattern FREE CHAPTER 2. The Builder Pattern 3. The Prototype Pattern 4. The Adapter Pattern 5. The Decorator Pattern 6. The Facade Pattern 7. The Flyweight Pattern 8. The Model-View-Controller Pattern 9. The Proxy Pattern 10. The Chain of Responsibility Pattern 11. The Command Pattern 12. The Interpreter Pattern 13. The Observer Pattern 14. The State Pattern 15. The Strategy Pattern 16. The Template Pattern Index

Summary


In this chapter, we have learned how to use the Facade pattern. This pattern is ideal for providing a simple interface to client code that wants to use a complex system but does not need to be aware of the system's complexity. A computer is a Facade, since all we need to use it is to press a single button for turning it on. All the rest hardware complexity is handled transparently by the BIOS, the boot loader, and the rest system software. There are more real-life examples of Facade, such as when we are connected to the customer service department of a bank, or a company, and the keys that we use to turn a vehicle on.

We discussed two Django third-party modules that use Facade: django-oscar-datacash and Caliendo. The first uses the Facade pattern to provide a simple DataCash API, and the ability to save transactions. The latter uses Facade for different purposes, like caching and deciding what should be returned based on the type of the input object.

We covered the basic use cases...

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 £13.99/month. Cancel anytime
Visually different images