Tumgik
#switchoffthelight
Photo
Tumblr media
Let's shine some light on switching off the lights. ✨Earth Hour tomorrow at 8.30 PM for (at least) one hour. Candles are cosy. But ofcourse we can do more! Get conscious about Mother Earth. ❤️ . . . . . #Feelgood #EarthHour #MotherEarth #Connect2Earth #Connect2Earth🌏 #SwitchOffTheLights #Conscious #Consciousness #WNF #JustDoIt #Babysteps
0 notes
anqizhaoanqi-blog · 5 years
Video
vimeo
DERIVE_Anthology_of_Superfluos_Activities_TAIWAN_2019 from ANQI ZHAO on Vimeo.
Eunemesi and Switchoffthelight collaborated in this participatory performance which premiered in New Taipei City, Taiwan. Inspired by a Chinese 17th century essay about "superfluous activities", we devised an exploration of the urban area for a small audience.
0 notes
mlbors · 7 years
Text
Simplify everything with the Facade Pattern
In this post, we are going to look at the Facade Pattern.
The Facade Pattern is a structural pattern that provides a simplified interface to a complex subsystem. It is like when we turn on our smartphone, we just push one button and we ignore all the operations that have to be done behind.
The goal of the Facade Pattern is to reduce coupling and complexity. However, a Facade doesn't forbid us to access to the subsystem. We can also have multiple Facades for one subsystem.
A Facade can be useful when we want to provide a simple interface to a complex subsystem, to layer our subsystems or when there are many dependencies between clients and the implementation classes of an abstraction.
Let's make a quick example of the Facade Pattern using PHP. Let's say we have a spaceship and we want it to take off or land on.
First, we create our SpaceShip class.
class SpaceShip { public function getPower() { echo "Getting power!"; } public function blink() { echo "Blinking lights!"; } public function makeNoise() { echo "Beep beep beep!"; } public function leaveTheGround() { echo "Leaving the ground!"; } public function getBackOnTheGround() { echo "Getting back on the ground"; } public function turnOffEngine() { echo "Turning engine off."; } public function switchOffTheLights() { echo "Switching off the lights!"; } }
And now we can create our Facade:
class SpaceShipFacade { protected $spaceShip; public function __construct(SpaceShip $spaceShip) { $this->spaceShip = $spaceShip; } public function takeOff() { $this->spaceShip->getPower(); $this->spaceShip->blink(); $this->spaceShip->makeNoise(); $this->spaceShip->leaveTheGround(); } public function landOn() { $this->spaceShip->getBackOnTheGround(); $this->spaceShip->turnOffEngine(); $this->spaceShip->switchOffTheLights(); } }
And we can use it like so:
$spaceShip = new SpaceShipFacade(new SpaceShip()); $spaceShip->takeOff(); $spaceShip->landOn();
0 notes