Composition over Inheritance

Mattias Petter Johansson, YouTube, Funfunfunction, Feb 19, 2016
Commentary by Stephen Downes
files/images/Composition.PNG

This video is about software architecture, but there are some deep thoughts here - philosophical thoughts, even - about whether to structure your software functions based on inheritance or composition. Inheritance defines classes of objects, and objects inherit properties and functions based on what they are. Composition defines classes of actions, and objects inherit properties and functions based on what they do. In philosophy, this is the difference between essentialism and functionalism. In learning technology, we face this question square on when we ask what makes something a learning object: what it is or what it's used for? So do watch this video; there are some pretty important core concepts. Here's the video transcript.


This has some pretty immediate implications for developers. For example, how do you build a learning application? If you're using modern web design you're probably working with objects directly, and most likely, the document object model (DOM) of the page you're working on. That's what libraries like JQuery do. But along comes a library like React, which instead defines actions instead of properties. In other words, it is based on composition. At first, it's harder to set up. But if you want a fast-responding page like a Facebook page, you want to develop it this way. Because by developing actions you're manipulating a model of the page, rather than the page itself (and you can even work with this model on the server side, which is useful for mobile apps).

Views Today: 1 Total: 223. [Direct Link]
Creative Commons License. gRSShopper

Copyright 2015 Stephen Downes ~ Contact: stephen@downes.ca
This page generated by gRSShopper.
Last Updated: Jul 01, 2016 05:10 a.m.