Intro In Part 2 of this series, we discussed how to model abstract systems, and what are some high level tradeoffs of adding an abstraction.
Now let’s go through examples of actual systems that utilize this concept.
Examples Object Oriented Programming (OOP) A typical example would be a farmer who has a list of fruits. We have a Farmer class which composes of a list of Fruit class. The Fruit class has a type (as enum) representing for example, a mango, banana, apple, etc.
Context In Part 1 of this blog post, we discussed at a very high level, why abstraction is useful. In the process, we also discussed Systems thinking.
In this post, we’ll go through real life examples of abstractions and systems.
But before that, let’s define these terms.
Abstraction is hard to define, and there in it lies the reason of why it’s such an overloaded word in a software engineer’s day to day.
Fall 2009, I was sitting in my dorm room at LUMS. It was sophomore year and I had just declared Electrical Engineering as a major. I was excited to learn about circuits! Curious to understand what else is out there, I found a wonderful resource online, OCW.1
I found 6.002, an introductory Circuits and Electronics course. The lecturer, Anant Agarwal, in the first lecture, talked about the concept of “Abstraction” in engineering and sciences.
Ever since I started working on distributed systems, I’ve found the “CAP Theorem” very confusing mostly because it’s over simplified and not well defined. It’s more of a rough guideline than a theorem.
Sacrificing P is not really an option. CP and AP are hard to map to practical systems; supposedly AP systems have interesting consistency properties. I find that the whole thing is actually too restrictive and doesn’t cover the design space.
Once every week or so, I’ve to quickly write up some script(s) to automate something, have more control over a workflow, write a tool, etc. There is a common theme that emerges:
Just write all the commands I need to run line by line in the script Wrap the above logic with conditionals or other logic based on the what I need to get done Handle error management gracefully i.