Code encapsulation is the most useful aspect of Object Oriented Programming. It allows to define specific functionality in one place, it bundles data with its functionality, it prevents unexpected modifications to object data by external code, and it facilitates cooperation between programmers working on the same project by letting them use each other’s methods without knowing the object’s internals.
Spiderwiz takes the encapsulation idea one giant step forward. Instead of code that is encapsulated in objects that refer to each other through methods, the interface is the objects themselves, strictly self-contained. A change in the object is broadcast when the object’s commit() method is called, and the change is handled by implementing the object’s onEvent() method. The same object type can have multiple functionalities, each of which is encapsulated in a different extension of the basic object.
Moreover, beyond encapsulating functionalities in objects, Spiderwiz facilitates the isolation of each object implementation in its own build unit. Build units interact with each other over a network in a way that is completely transparent to the programmers. Regardless of whether object interaction is inter-process or inter-service, programmers would write exactly the same code. For explanation how it works see our blog post Lean and Mean – Under the Spiderwiz hood.
All this implies that Spiderwiz is an ideal platform for building systems of microservices that interact in a service mesh. Actually, as every object’s implementation can be put in its own service, we can call them nanoservices. Whatever is the name, the measureless benefits to developers and system administrators are apparent.
A nice demonstration of this concept can be found along our Tutorial. The scenario that interweaves its lessons is of a Chat system. We start by simple message broadcast, go through managing chat rooms, put in a user registration facility, add a message archiving feature, and conclude with a bridge that connects the system to another chat system that uses another technology. All is done by adding a service by service, barely touching the work of a lesson by the subsequent one, implementing each feature as a standalone building block, and putting it all together like when assembling a Lego construction.
Go ahead and see how programming is a joy when it is easy as a Lego toy.