Design Pattern — Quotes

askdmaslsdaljdaljdlajdalsdjaljdaljdlajdajdaljdlajdaljdlajdlajdlajsdlajdlsajdlajdlajdlajdlajskdjasldjasldjalsdjaljdajdlkajdlajdlajdlajdlajsdlasjdlajdlasjdlajdlasjdlajsdlajsldjasdlakjsdlajdadalkd akjsdadakdakdadadkadhakjhdajdhakdhakdhakdhakhdakhdakhdkahdakshdakhdkashdaskdhkahdkahd hello world testing

.
1 min readApr 28, 2019
  • Interface is the baby-step to better design.
  • Interface caused inheritance.
  • Inheritance is static. Inheritance is like English, it creates new word to new meaning instead of reuse-compose existing words. i.e: “eleven” instead of “ten-one”.
  • Composition. Holding a reference to target object. Take full controls/responsibility on target object. Also known as wrapper.
  • Inheritance vs Composition. We use interface as type matching, composition to get new behaviour.
  • Reference. Represent field/variable/property/attribute of a Class. Usually, pass in via Class constructor.
  • Decorator. Takes in a reference (behaviour) and act like disguise/double/agent. Enforced by Interface. A decorator is linked to another decorator via reference. Decorator is a linked-list of algorithms.
  • Abstract. Interface that can be instantiated(new).

References

--

--

.
.

Written by .

Engineer & runner based in Bangkok, Thailand.

No responses yet