top of page

Collections Composition and Encapsulation for life


There are a lot of things from basic understanding of computer language which we can gather to understand the nature of what we see around us. Even if you are a non-programmer that is totally fine. I will introduce you to some principles of programming, in general which are not limited to programming itself. To understand and tackle with complexity of the program, there are principle of data encapsulation are used.


Have you ever tried building with Legos? If you look at the process, simple Legos few types of blocks are put together to develop complex structures. You will see this pattern repeated everywhere. Even building of towers, assembly of a car, developing a software. In software engineering, to improve the process a layer of data encapsulation is used. In simple terms it means a well-structured piece of code, which has specific functionality. These pieces of code can be used wherever necessary without need to worry about the internal architecture


input -> encapsulated code -> output

fuel -> engine -> mechanical energy

If you compare this to assembly of a car, it is like building a engine, Chassie, body, gears separately. Which has their own input processing and output. These items can be later put together to make a car. Most importantly the process is faster and smoother as each and every piece is optimized for the best of function by the experts. There is no way a single person could tackle the complexity of everything, otherwise, which is unnecessary as well.

Computer A collection

So, what message can we get from these programming principles (collections composition encapsulation) for life?


I can give you a few. You can enumerate more as you would go along your journey.


Imagine you are trying to build a complex structure. Maybe you are trying to write a novel. Maybe you are trying to understand a complex subject matter for your semester exam. Maybe you are trying to organize a party. Thinking about such a complex task itself is overwhelming.


Only way you can tackle such a task is only by focusing on each piece separately and trust the process of encapsulation. The composition and complexity will eventually come later, and everyone will admire your handy work and even be amazed how you have achieved it.

(However it is also important to try to understand the complexity in the outset as well- as in blooms taxonomy)


A tree on a mountain slope


More importantly when you observe things in life, we are just looking at the complexity and admire it as it is. However, we forget the simplicity has created it. As an example, we admire the Lamborghini, yet we do not see that it is a composition of tiers metal, plastic fluids, etc. which has less meaning and value if separated. Ultimately, we will start to lose the value in Lamborghini, at least lessen it.


Why? you may ask.

I will write that article later.-> (How things are valued)



26 views

Recent Posts

See All

Comentários


bottom of page