While taking a session with a set of mobile developers, one of them asked a question that made many of them curious.
Why multiple classes when single class can do?
Lets look at some of the key advantages of multiple classes, each one of them having single functionality.
Let’s say a class is performing multiple different functions. Mathematically, the class can be represented as following:
Class A = f(x) + f(y) + f(z)
Let’s say, one needs to fix a bug related with f(x). Thus, one fixed the code in the class A that performed f(x). The code was, then, shipped to QA engineers. QA engineers used to spend, let’s say, 1hour for each function. Thus, for a change in one function he spent 3 hours.
The total cost of change is 3 X (let’s say $20/hour as rate for QA engineer) = $60.
Thus, it makes much more sense to split functionality into different classes as the change will be less costlier than following the approach of having multiple functionality in one class. The design leading to this approach (multiple class) could also be termed as “Cost-effective” design.
As Large Language Models (LLMs) evolve into autonomous agents, understanding agentic workflow design patterns has…
In today's data-driven business landscape, organizations are constantly seeking ways to harness the power of…
In this blog, you would get to know the essential mathematical topics you need to…
This blog represents a list of questions you can ask when thinking like a product…
AI agents are autonomous systems combining three core components: a reasoning engine (powered by LLM),…
Artificial Intelligence (AI) has evolved significantly, from its early days of symbolic reasoning to the…