top of page

4. Abstract: Framework for Structured Flexibility in Business

  • Writer: Puneet Malhotra
    Puneet Malhotra
  • Nov 14, 2024
  • 6 min read

Updated: Jan 8


🔄 Quick Recap: 

In the previous topic, Polymorphism- for Flexibility in Business, we explored how the concept of Polymorphism emerged from the necessity for freedom and flexibility in business processes, while still allowing management to maintain control.


Need of Framework


There must be a framework that allows for accountability to bring safety and security in the process. In this article, we will explore the OOP concept of abstraction to define a framework in business processes.


One day, the owner was thinking:

We've discussed control, management, and secure business processes, but do we truly have control over our processes? How can we guarantee that partners adhere to the necessary procedures?


Observations and questions raised:


  1. Flexibility and autonomy have been provided.

  2. The foundational process for indexing and centralized management is established.

  3. It is the managers' duty to design and oversee the implementation of the process for partners.

  4. However, who is responsible for verifying that essential functions have been incorporated into the partner's process?

  5. How are we mandating managers or process implementers to implement or include required functions or tasks in the franchise partner's process?


Critical Concern 🚨 🚨

How can we ensure that partners carry out the necessary functions or tasks?


👉 This now appears to be a more significant challenge, as business has grown considerably. It has numerous partners across the region, and even a minor mistake could lead to substantial losses.


He chose to tackle this issue and arranged a meeting for the following day with:-

  • Some partners to understand their work process.

  • Managers to review processes.


Before the meeting, he listed the crucial functions, methods, or tasks that needed to be performed. Failing to do so could affect the product quality and, consequently, the brand value.

  1. handleCustomerFeedback

  2. sendOfferToCustomer


He wants to ensure:-

  1. Partners are sending new deal and taking customer feedback timely

  2.  Flexibility as these two will be implemented from partners only.

  3. Partners to provide monthly report for Customer Feedback and customer deal Update.


Meeting with Partners:


In meeting with partners, business owner found that:-


  1. 40% were taking Customer Feedback

  2. 70% were sending new deal to Customer

  3. He checked base process and both functions were included.


He asks partners why they have not implemented these functions although reporting on Customer Feedback and Sending Deal to Customer are part of process.


They responded that Customer Feedback and Sending Deal to Customer weren't specified, so they implemented it based on their requirements.


But this is not acceptable for owner. He explains the usefulness and necessity of both functions as they can benefit business in long run.


Although the partners agreed and committed to implementation, but the owner wanted guarantees.


Word "Guarantee" echoed in his mind and very quickly he figure out the root cause of problem.


The next step was to meet with managers to examine the process and implement a solution.


Problem Finding Starts


He held a meeting with his managers and presented them with this issue.


🙋 One Manager stood up and said - In the existing business process structure, these elements are incorporated into every base process for each partner.


As a result, they must comply with the policy they are required to implement.


📌 Owner said, and how can we guarantee that partner's process are having the required functions or tasks ?


For Example, check below 👇, where Base Process is having both functions but Franchise City Bakery and Suburban are missing one of functions


How was this overlooked, and who did it?


📌 Its a miss from management side who have not properly created process for partners. Some of the process of partners are missing required functions. So we can't blame partners as functions are not included in their process.


He emphasized further:

Should I inspect each partner's business process to ensure compliance? These types of human errors will grow as the business expands over time. Therefore, we need a foolproof solution that compels process implementers to implement the necessary functions.

The owner was concerned and went on,


Listen, everyone, I'm focusing on the larger perspective. I'm planning for the future, when our team expands. There will be many more essential functions like this. The larger the team, the greater the potential for mismanagement. My goal is to guarantee that all partners' business processes adhere to specific agreements and that I can oversee them efficiently.. We need to find 🔍 that solution.


The managers understood and agreed with the problem statement, ending the meeting with the goal of finding a solution.


Need of Partial Contract


One of managers reviewed the existing process and pointed out two things:


  1. Framework to bound managers to implement mandatory functions.

  2. Flexibility for partners to customize functions to take Customer Feedback and Sending Deal to Customer in their own way.


Brain Storming: Design should consist Flexibility + Framework.


He drafted a process of ,Partial Contract type, where:

  1. They made function mandatory and available to be overridden

  2. Some non-mandatory functions were also kept


📌 In short, process is something like other classes except mandatory functions. These mandatory functions can ensure implementation of required functions.


Next meeting got setup to discuss the draft with managers.


Discussion started with scenario


  1. Bakery stores need to have own Feedback and Sending Deal functions

  2. Business need functions mandatory

  3. Business need proper reporting of work as well.


Manager presented a different type of Base Process ,like a Partial Contract, having necessary functions which can impact brand value.


He mandated certain functions in the base process, making it a requirement for all managers to incorporate these functions into each partner's process whenever we extend this new base process.


📌

The Partner Process builds upon this partial-contract-type base process, and if a required function is missing, the same partner process will be deemed invalid and rejected.


So this has become Partial Contract between Process Implementors and Business.


Using this partial-contract-type process guarantees that the process implementor will incorporate the necessary functions into the Partner's process.



🤗 The owner was impressed when they saw the solution, as it offers both structure and flexibility to the partners.


✍️

This process requires partners to implement handleCustomerFeedback and sendDealToCustomer, but they can do so in their own way. GenerateMonthlyReport is not mandatory, but partners will need to generate the report while the business manages the logic to create it.  In this manner, businesses have guaranteed the implementation of Feedback and Deal Update.

Business Owner has given two types of flexibility to partners:-

  1. Customization - Function's implementation can be modified as per there need.

  2. As-is: If required, functions can be included as-is from base process.

Pseudo Code


Lets see how we can translate our functional understanding into code:-


Base Class:

public abstract class customerCareContractProcess {
   
    public abstract void handleCustomerFeedback(String orderId);

    public abstract void sendDealToCustomer(String itemName, Integer      quantity);

    
    public void generateMonthlyReport() {
        System.debug('Generating standard monthly sales and deal update report.');
    }
}

CityBakeryFranchise

public class CityBakeryCustomerCare extends BakeryFranchise {
    private List<String> customerFeedbacks = new List<String>();

    public override void handleCustomerFeedback(String feedback) {
        customerFeedbacks.add(feedback); // Collect feedback

      
        System.debug('City franchise received feedback: ' + feedback);
        System.debug('Responding quickly to customer feedback in city franchise.');
    }

  
    public override void sendDealToCustomer(String dealName, Integer minquantity, Integer discount) {
        System.debug('Exciting Offer on ' +'Flat '+ discount + '% on' + itemName + ' - at minimum quantity: ' + quantity);
     
    }
}

SuburbanBakeryFranchise

public class SuburbanBakeryFranchise extends BakeryFranchise {
    private List<String> customerFeedbacks = new List<String>();

    
    public override void handleCustomerFeedback(String feedback) {
        customerFeedbacks.add(feedback); 
      
        System.debug('Suburban franchise received feedback: ' + feedback);
        System.debug('Following up personally with the customer for feedback in                   suburban franchise.');
    }

         public override void sendDealToCustomer(String dealName, Integer minquantity, Integer discount) {
        System.debug('New Offer ' +'Flat '+ discount + '% on' + itemName + ' No Minimum Quantity ');
     
    }
}

Report:

BakeryFranchise cityFranchise = new CityBakeryFranchise();
BakeryFranchise suburbanFranchise = new SuburbanBakeryFranchise();


cityFranchise.handleCustomerFeedback('The new chocolate croissants are amazing!'); 


suburbanFranchise.handleCustomerFeedback('I loved the personalized service during my last visit.');

cityFranchise.generateMonthlyReport();
suburbanFranchise.generateMonthlyReport();

Thought-Provoking


How did the concept of Abstract Class come into play?


Problems arrived first:

  1. Required functions were missing in partner's process.

  2. Including required functions in franchise partner process were not mandatory.


Solution Identified :  

  1. Create a unique type of process where there is contract with process implementor to include required functions included in franchise partner process.

  2. This process can have function definition which can be overridden on demand.

  3. This process should give flexibility to process implementor to include concrete ,which can not be overridden, functions.


Design Approach:  

  1. Create Abstract class, where mandatory functions to be included separately. Process implementor can easily find required function to be included in partner franchise process.

  2. Process Implementor can provide business logic inside any function of this class.

  3. Only mandatory functions are allowed to be overridden.


Comments


Drop Me a Line, Let Me Know What You Think
or Any other Technical topic you want to understand in NonTech style.

© 2025 by NonTech-Techie

bottom of page