Speaking of extensibility, first we need to distinguish the so-called white-box and black-box approaches. White-box extensibility means that software system can be extended by modifying/extending the existing source code. This looks very much like flexibility and it is truly so.
Actually, it is the logical sequel which stems from the same low coupling and modularity principles. The source code that deeply embodies those principles is easy to maintain, change and extend. In my career, this statement was proved in practice many times. Converse is also true, I checked – don’t go there 🙂
The main challenge here is that object-oriented programming (OOP) and interface-based architecture by nature are tightly-coupled. Meanwhile, system decoupling demands:
- a profound understanding of the issue
- the use of best platform-specific decoupling practice
- the whole development team has to embrace this idea and keep dependencies under control on a daily basis
Last but not least, let’s take a closer look at “black-box” extensibility. The black-box approach means that any new module has zero knowledge about the system it is integrating with. It just implements the interface specifications provided by the system.
There are a variety of ways to build APIs, but recently the data-centric approach is becoming more and more popular. This is for a good reason. It turns out that the best API for decoupling system components and system-of-systems is data itself.
For example, let’s take REST – simple 4 methods for manipulating data:
- POST – Create
- GET – Read
- PUT – Update
- DELETE – speaks for itself
These 4 methods are actually enough for transferring any data between system components. There is no need to invent new wheels and bikes and create complex APIs with hundreds of methods like GetUserName(id), SetUserName(id, name, magicParameter), createNewGroup(type) and so on.
Instead, we just compose a data structure and use the appropriate method from these four to transfer the data. Another alternative gaining popularity these days is “data publishing”. Take a closer look at the Firebase or PubNub solutions – this is how true black-box extensibility looks like. This is how the Internet of Things will look like. However, this is a topic for another article. Stay tuned!