Facade design pattern is useful pattern for complexity of a class, then provide an simple interface for user for using that complex class.

Facade pattern used to simplify to access a complex class

example of implementation : https://github.com/alrifqi/DesignPattern/tree/master/facade

in example source code, main.py  is main script which accessed by user, main.py call Facade class in facade.py

this facade.py act as wrapper/interface of all sub function. facade.py call weather.py, weatherprovide.py, cache.py, converter.py, parser.py to perform a process for getting temperature of city which user entered in main.py

Categories: Code

0 thoughts on “Facade Design Pattern in Python”

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Code

Docker Compose untuk Laravel 5.4

Saya sedang mengerjakan projek dengan menggunakan Laravel 5.4 (saya tidak menggunakan Laravel 5.5 karena requirementnya membutuhkan > php 7). ternyata Laravel 5.4 ini membutuhkan php 5.6 dan AMPPS (semacam XAMPP / MAMP) yg saya pakai Read more…

Code

Login Page UI – React Native

Saya membuat login page menggunakan react native (tentang react native bisa melihat ke https://facebook.github.io/react-native/) login page yang saya buat ini sebenarnya sangat sederhana. Pertama install terlebih dahulu react-native npm install -g create-react-native-app Buat project react native Read more…