2. Inheritance: Centralized Control for Business Efficiency
- Puneet Malhotra
- Nov 14, 2024
- 5 min read
Updated: 2 days ago
Quick Recap: 🔁
In previous topic Class & Object to create Work Process. We have discovered functional significance of Class and Object. We have seen how the concept of Class is similar concept of SOP (Standard Operating Procedure).
Understanding the functional significance of Class, Object, attribute, and Constructor is crucial before delving further into OOP concepts.
Impact of Process/SOP on Business
Bakery business that’s been successfully running for two years. The owner has developed a well-defined SOP or process for handling everything from baking to customer service.
These process are the backbone of the business and helps the staff—chef, accountant, guard, and manager—work smoothly.
Whenever a new employee is hired, they are quickly trained because of this structured process. This setup works perfectly for a single location.
Franchise Model: New Business Expansion
Owner decides to expand into the franchise model and onboard two partners - UrbanBakery and RealTasteBakery
Both partners comes up with their individual demands:
UrbanBakery - Local vegetable vendor supply
RealTasteBakery - Need freedom on bulk purchasing (monthly truck shipments).
The business has its own inventory process (SOP) BakeryInventory, which serves two functions.
Supply core ingredients (flour, sugar, eggs).
Standardizes restocking limit
What partners are asking, is not part of the core business process. Hence, It would require three separate inventory processes to meet customization
BakeryInventory - core process
Customized process of UrbanBakery
Customized process of RealTasteBakery
Owner creates two more individual processes for each partner. Now, each partner has their own business process.
Base Process for BakeryInventory

At first glance, it appears to be a straightforward and manageable. However, the business now has three separate processes to oversee.
🤔 What if its required to update core business functions ? It means, all three business processes has to be modified.
Today, the business has only 2 partners. What if the business has 20 partners? Then, will the business have to modify 20 business processes? 🤔
This approach appears to be inefficient and insecure.
Hidden Costs of Customization
The business owner has a very good business sense, so he can anticipate the challenges that may arise due to customization in the long run.
📉 Scaling Barriers: As the business expands, increasing franchise partners multiply customization requests, making what works for ten partners unmanageable for a hundred.
Management Complexity: Maintaining dozens of unique processes creates inefficiencies. Standard oversight becomes fragmented, increasing administrative burdens and coordination costs.
Critical Process Gaps: Key processes—like quality control or branding—may get ignored or applied unevenly across locations.
🎯 This decentralized approach might work fine with a small number of franchises, but as the business grows, this system shows clear flaws.
Need of Centralized Approach
To keep control of core business functions, business owners create a base process that incorporates the core functions. If any partner needs them, they will have to use the functions defined in the base process instead of getting them defined in their individual process.
This becomes the base process that ensures product quality and consistency.
For example:
Process 1 (BakeryInventory ): This is the base process used by all franchises, covering the core operations like core ingredients supply, recipe control and branding.
Process 2 (UrbanBakery ): Use the base process with inclusion of specific adjustments, such as local vendor supply for veggies.
Process 3 (RealTasteBakery): Also use the base process but with inclusion like bulk purchasing (monthly truck shipments)

With this centralized system in place, whenever the bakery owner makes improvements to the inventory process, all franchises automatically inherit those common features.
This means the owner only needs to modify the base process, and the updates gets applicable to all.
Inheritance
This setup is similar to inheritance in Object-Oriented Programming (OOP). In OOP, a parent class (like the base process) contains the core functionalities that are shared across multiple child classes (the customized processes for each franchise). The child classes inherit the functionalities of the parent class while also allowing for extensions or modifications as needed.
The advantages of this approach are:
Efficient management: The owner can update the base process once, and all franchises will inherit the common features or changes or business process automatically.
Consistency: Every franchise maintains the same product quality because they all use the same core process.
Scalability: The business can grow without the complexity of managing multiple processes for every new franchise.
📌 In the world of software, this is exactly how inheritance works. It allows for flexible and scalable development by letting child class (process) inherit behaviors from parent class (process) while still supporting specific customizations. Just as the bakery owner uses this approach to manage his growing business, developers use inheritance to manage and scale software applications secure and efficiently.
This helps ensure that, even as applications grow in complexity, they remain easy to update, maintain and secure —just like a well-run franchise.
Functional to Tech Coding
Let's explore how we can convert our previous functional discussion into technical code.
Parent Class: Base Process for Customer Handling
public virtual class BakeryInventory {
// core functions of business under base process
public void supplyCoreIngredients() {
System.debug('Supplying flour, sugar, eggs');
}
public void restockingControl() {
System.debug('Applying standard restocking logic');
}
}
Franchise RealTasteBakery : Extended Base Process
public class RealTasteBakery extends BakeryInventory {
public void monthlyInventory() {
supplyCoreIngredients(); // using function of base class
restockingControl(); // using function of base class
bulkPurchase(); // function specific to franchise
}
public void bulkPurchase(){
System.debug('Bulk Order Placed');
}
}
Franchise UrbanBakery : Extended Base Process
public class UrbanBakery extends BakeryInventory {
public void setUpInventory() {
supplyCoreIngredients(); // using function of base class
restockingControl(); // using function of base class
useLocalVendor(); // function specific to franchise
}
public void useLocalVendor(){
System.debug('Calling Local vendor');
}
}
UML Diagram

Strength of This Approach
Centralized Control (Base Class) = Business Consistency
Technical: The parent class (BakeryInventory) have control on core functions(e.g., supplyCoreIngredients(), restockingControl()).
Business Impact:
a. Ensures all franchises follow the same foundational process.
b. Mirrors how McDonald’s HQ mandates fryer temperatures globally.
Easily Manageable = Scalable Business Processes
Technical: Child classes (UrbanBakery , RealTasteBakery ) extend (not rewrite) the base class.
Business Impact: Local flexibility: Franchises add restockingControl() or supplyCoreIngredients() without altering HQ’s code.
Thought-Provoking
How Inheritance got discovered
Problems arrived first:
Centralized Control.
Too many process having duplicate methods.
Cumbersome management.
Updating each franchise is time-consuming and risky.
Solution identified: Centralize Approach to control on demand customization.
Design : Keep common feature or required at one place and let the process to extend.
Click to Learn➡️ Polymorphism for Freedom and Flexibility in Business
DIY 🤹🏽🤹🏽
Create your own explanation of the Inheritance concept using the scenario provided below
Imagine a scenario where you need to allocate two team members under your team leader. For instance, the head chef has a team consisting of a helper, for chopping, and a bakery chef. They all belong to the same business process, and junior team members are assisting the Head Chef and also sharing common tasks.
All members are part of the same business process.
It is necessary to establish a distinct business process for each to assign tasks.
Junior team members should assist in sharing the team leader's workload.
Remember, you need to manage the process efficiently as your team size and workload will increase over time.
Comments