08 Mar 2023
Facade:
jQuery is a facade for JavaScript featuresclass House {
private plumbing = new Plumbing();
private electrical = new Electrical();
public turnOnSystems() {
this.plumbing.on();
this.electrical.setVoltage(120);
}
}
Proxy:
Why? For example you have a large object that you only need occasionally.Benefit: If you need to execute something either before or after the primary logic of the class, the proxy lets you do this without changing that class.