Software development and legos have things in common. As Lego consists of colorful interlocking plastic bricks. Each of these blocks assembles and connect in many ways to construct objects, vehicles, buildings, and working robots.
A good software developer writes code like Lego pieces. Each piece of code is a small, independent, and interactive unit. Code packages can be re-used within a project or outside the project in more than one application. Modular code is self-sufficient. To use a well-written piece of code, we need to know what it does and not how it works. We can import a code within any project and it starts working without any conflict.
Reusability and abstraction are essential to software development. It was always there and coders have been leveraging this since long. We will discuss recent technology and development paradigms that further helps in achieving the goal. Here we look into one recent technology Docker. And we discuss two development paradigms – functional programming and micro-services. Let’s see how each of these helps in little more detail first:
In functional code, the output value of a function depends only on the arguments that are passed to the function. So calling a function f twice with the same value for an argument x will produce the same result f(x) each time. This is in contrast to procedures depending on a local or global state, which may produce different results at different times when called with the same arguments but a different program state.
This makes the code portable, as there is no side effect in these codes.
It is a variant of the service-oriented architecture (SOA) architectural style that structure an application as a loosely coupled services. Each service has a single responsibility and serves only one purpose. Smaller services improve modularity and make the application easier to understand, develop, and test. It also enables a small autonomous team to work in parallel and allows building, deploying, and scaling any service independently. Individual service can be refactored continuously and independently. It helps in achieving the right architecture for each service. Also, it allows building a polyglot application naturally.
Microservice base architectures enable continuous delivery and deployment.
Containers are packages that rely on virtual isolation to deploy and run applications. It accesses a shared operating system (OS) kernel without the need for virtual machines. Dockers are one popular technology, which implements this mechanism. Docker is a tool that can package an application and its dependencies in a virtual container that can run on any server. This helps enable flexibility and portability. An application on docker can run, anywhere – on premises, public cloud, private cloud, bare metal, etc.
High-quality product team always prefer to re-use tested code. Reusing and extending, instead of re-writing the same feature again, reduces technical debt. While saving the resources, it improves the quality of the product. Re-usability and modularity are two coding principal which we can’t miss in high performant culture. And that is how you build a product like LEGO.42
- Functional programing