Component-Oriented Programming
What Makes a Component
A component, in this sense, has three defining properties:
- Encapsulation — its internal implementation is completely hidden; only its interface is visible from outside.
- Interchangeability — any component implementing the same interface can replace another, and the rest of the system can't tell the difference.
- Independent deployment — a component can usually be built, versioned, and shipped on its own, separate from the application that uses it.
This is a difference of emphasis from plain OOP, not a wall between them — a component is very often implemented internally using ordinary classes. What component-oriented programming adds is the discipline of talking to that implementation only through its interface, everywhere, all the time.
Composition Over Inheritance
Deep inheritance hierarchies couple a subclass tightly to its parent's implementation details, which makes both hard to change independently — a problem often called the "fragile base class" problem. Component-oriented systems favor composing small, independent pieces through their interfaces instead, precisely to avoid that coupling. This preference shows up across the industry as the design principle "favor composition over inheritance," which predates and outlives any one language.
Representative Languages and Platforms
The first four have their own pages. The last two are historical standards worth knowing by name.
| Language | Why study it |
|---|---|
| Web Components | The browser's native component model: custom elements with a private shadow DOM. |
| OSGi | Dynamic Java modules and services that can be installed and replaced at runtime. |
| .NET Components | Assemblies, interfaces and dependency injection as the standard way to build C# systems. |
| Angular | A full framework where every part of the UI is a component with inputs, outputs and injected services. |
| Enterprise JavaBeans | An early, influential (now largely legacy) standard for server-side components with a managed lifecycle. |
| COM (Component Object Model) | Microsoft's binary component standard: components in different languages interoperate through a shared binary interface. |
See it in a full demo: Demo 11 — Web Components and Demo 12 — C#.
Related Ideas That Are Not Quite This
Two terms often come up alongside component-oriented programming, and both are worth naming precisely rather than folding into it:
- RAD (Rapid Application Development) is a software development methodology — fast iteration, prototyping, visual builders — comparable to Agile or Waterfall. It describes a development process, not a way of structuring running code, so it isn't a programming paradigm in the sense the rest of this roadmap uses the word. RAD tools do very commonly generate or assemble component-oriented code, which is likely why the two get associated.
- No-code / low-code platforms let you build an application by arranging visual elements instead of writing text. What runs underneath is usually a declarative or dataflow description — arguably closer to a form of visual programming than a distinct paradigm of its own — and the platform itself is a development tool, not a language you write programs in.