Content-type: text/html Downes.ca ~ Stephen's Web ~ Composition over Inheritance

Stephen Downes

Knowledge, Learning, Community

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).

Today: 1 Total: 101 [Direct link] [Share]

Image from the website
View full size


Stephen Downes Stephen Downes, Casselman, Canada
stephen@downes.ca

Copyright 2024
Last Updated: Nov 21, 2024 07:58 a.m.

Canadian Flag Creative Commons License.

Force:yes