The Principle of Immutability

  1. The Git Principle
  2. The Maven Principle
  3. The Principle of Immutability

Immutability & Object-Oriented Design

The immutability principle is so universal that it can be appreciated at the most basic level and at the most advanced level. We can also look at it from an Object-Oriented programming perspective. Every object has a state and behavior. The internal state is its own business, and the only way an object should be modified is via behavior. The internal state of an object being hidden is called encapsulation.

Immutability & Gang of 4 Design Patterns

The principle of immutability intersects multiple Gang of 4 design patterns. The immutable artifact creation can be related to the factory method. Artifact cloning can be related to the prototype and memento pattern. Updating artifacts can be related to the state pattern.

Immutable Infrastructure & Environments

When designing the Roost.ai Environments as a Service platform, one of the key considerations was how best we could provide immutable infrastructure for pre-production workloads. Following the pattern in the previous section, roost platform:

  1. Instantly creates versioned environments (using blueprint created from repository inference).
  2. Creates as many copies of the environment as needed.
  3. Update environments as the source repository changes.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rishi Yadav

Rishi Yadav

This blog is mostly around my cloud-native & Environments-as-a-Service (EaaS) technology insights. I would throw some crypto wisdom here and there.