What is SQL injection?

SQL injection is a type of security vulnerability that occurs when an attacker injects malicious SQL code into a web application’s input fields, such as a login form or search box. The goal of the…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Generalization in the context of Software Engineering

A generalization is a form of abstraction whereby common properties of specific instances are formulated as general concepts or claims. When the mind makes a generalization, it extracts the essence of a concept based on its analysis of similarities from many discrete objects. The resulting simplification enables higher-level thinking.

Generalization is a process of extracting shared characteristics from two or more objects/processes and combine them into generalizing objects/ processes. This high-level concept is being used everywhere for different purposes in traditional software engineering practices. There are a few listed below.

Generalization is mainly to identify the common characteristics of the process or model and extract it as the generic and reusable function/model to reduce the redundancy because in traditional software engineering practices it is considered as the bad practice. I’d like to highlight the reusability aspect of the generalization and it is important from different angels.

1. Maintainability — Reusability improve the maintainability since enhancements or bugfixes only needs to be done in a single place.

2. Development effort — Less redundancy reduces the development effort.

3. Development cost — Improve the maintainability and development effort reduction helps to reduce the development cost as well.

4. Standardizing the process — Reusability indirectly helps to adapt to the application standards.

As we discussed generalization is important in software engineering due to various reasons, but an important point is a scope that we need to consider for the generalization. Let’s talk about the very high-level business scenario to understand the importance of the scope.

The above image shows two different approaches for a similar use case. Let’s assume we have a use case of managing a system that is for different departments (Sales, Support, Accounting, and Order) and each department needs to maintain the customer details.

Approach 01: — Generalize customers for the whole business use case and make it as the generic component/model.

Approach 02: — Consider the requirement of each department and generalize within the department.

The above two approaches generalize the customer in a different scope. First approach generalizes customer considering context doesn’t matter and the second approach is considering context matters. The first image shows how important context is. Everyone looking at the elephant but based on the context each can see the different parts of it. Generalization is a very useful concept, but it should be within the context.

The above image shows another example. Both images show the same pizza piece but in a different context. You will pay for the left-hand side piece but will not get the right-hand side one even for the free. So, context is matters for the same object.

Divide and conquer is a very common approach that we usually practice when we face complex problems. We always try to understand the individual pieces of complexity. This is not a difference in the software development world as well. We started to break them into different applications with goals to easily manage individual applications.

Object-oriented design is a well-known concept among the software development community and it is basically thinking in terms of and objects. Similarly, Strategic designing is thinking in terms of the context.

When we think about the business domain like airline, e-commerce or banking it can be split into few subdomains (Ex:- E-commerce -> Sales, support, account, order,..etc). In the solution space, we called bounded context for the same sub-domain in the problem space.

Generalization is a very useful concept in software engineering. There is a number of advantages that can be gained from it, but the scope is important to understand since scope matters when it comes to large business problems. DDD is important to understand the contexts within the large business domain and generalization should be within the bounded context. Ubiquitous language should be used to define the terminologies of the generalize process/attributes.

Add a comment

Related posts:

The Journey of Walking

I would say that our feet are the soul connection to the universe, my reasoning. Our feet are the one portion of our entire body that solely connects and touches the earth, any other part of us has…

Putting Polarized Training Into Practice

Have you heard about “polarized” training for running, cycling, and rowing? There are LOTS of articles and videos about polarized training. I should know, my father, Stephen Seiler, introduced the…

Welcome little one.

As I await in the lobby for news from your father about your arrival I just want to to say — Welcome to the team. It is not a big team but we’re also not that small either. You are the fifth to join…