Design <i>patterns</i> in software development: heroes or villains?

Column

Digital

Innovation

Technology

February 26, 2025

Design patterns in software development: heroes or villains?

Tool reduces code complexity and enables adaptability, but its impacts must be analyzed before implementation

There has been much talk about the use of design patterns in software development and its benefits. However, does the mere use of these patterns really guarantee the solution to the problems they are intended to solve?

The design patterns (or project patterns) are standardized solutions for recurring problems in software projects, offering templates for problem resolution, which makes the code modular and readable.

The expectation is that these standards will be used to facilitate maintenance and optimize software efficiency, improve the quality of code and facilitate communication among development team members. Furthermore, as the tool reduces complexity and provides reuse and adaptability of the code, it also enables productivity gains for the team.

The history of software design patterns is not recent. The idea emerged in architecture before being applied to software development. In 1978, architect Christopher Alexander, along with Sara Ishikawa and Murray Silverstein, cataloged 253 common architectural problems and their solutions in the book “A Pattern Language: Towns, Buildings, Construction”.

Alexander defined that a pattern should have the following characteristics: encapsulation, generality, balance, abstraction, openness, and combinability. These characteristics ended up influencing the development of software design patterns. Later, in 1987, Kent Beck and Ward Cunningham presented the first patterns in the area of computer science, for object-oriented languages.

However, only in 1994, influenced by Alexander’s work, did the popularization of design patterns in software development occur. The release of the book “Design Patterns: Elements of Reusable Object-Oriented Software”, by the “Gang of Four” (GoF) — Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides —, cataloging 23 design patterns, formalized the use of the tool in the area.

When using design patterns, it is essential to understand each category to choose the most appropriate pattern for the problem to be solved. Therefore, these patterns have been divided into three categories:

  • Creational Patterns: allow for creating objects without “tying” the code to specific classes, which require control over the creation process. It’s like ordering a sandwich at Subway: you can choose the bread, the filling, the cheese, and the salad, but you allow the attendant to assemble your sandwich their way. This ensures flexibility (you can choose different types of cheese and sauces), reusability (the same ingredients can be used to produce different sandwiches), and independence (new ingredients can be added without you needing to change how you place your order). Some examples of creational patterns are Builder (a class that creates objects to represent a report with different types of filters, columns, and formatting options), Factory Method (an application can use this pattern to load plugins or extensions, where each plugin is instantiated by a specific factory), and Singleton (can be used for the creation of an object that stores application settings, such as database connection information or user preferences);
  • Structural patterns: focus on the construction of complex systems from smaller parts (objects and classes), which can fit together in different ways through the same interface, making them very suitable when high flexibility between parts needs to be ensured. It works like Lego bricks: although there are pieces of different sizes, colors, and purposes, the “fitting pattern” is always the same, allowing many different things to be built with the same pieces. Examples: Adapter (when a system using a payment processing library with a specific interface needs to communicate with another payment library with a different interface) and the Facade pattern (for example, during user registration in the system, the registration interface interacts with a class, which coordinates necessary actions in the validation subsystems, such as database persistence and sending a confirmation email);
  • Behavioral patterns: deal with how the objects of a system work together when performing a task. This pattern is useful when flexibility in communication and separation of responsibilities within the system is needed. Think of an orchestra: each musician (object) plays their instrument following their own score (their code) and is responsible for producing different sounds; their behavior is determined by the conductor’s commands (increase volume, change tempo). A very common example is the Observer pattern (a news platform can use this pattern to notify subscribers when a new news item is published); another example is the Command pattern (in applications with graphical interfaces, it is used to represent the actions that can be performed by users through menus and buttons; each menu item or button, such as “Save”, “Open”, “Copy”, and “Paste”, can be associated with a specific Command object, which encapsulates the logic needed to perform the action).

Some studies have shown that projects with teams of larger development tend to use design patterns more frequently. This demonstrates that patterns are used to improve documentation and communication among team members. Furthermore, developers with more experience in programming and design are more likely to use design patterns.

Al-Obeidallah (2021) analyzed the impact of the Adapter design pattern on software maintainability — a quality attribute that indicates how easy the software is to understand and modify. The authors created versions of four software systems without the Adapter pattern, using refactoring techniques, and compared software metrics between the versions with and without the pattern. The analysis of these metrics, correlated with maintainability in previous studies, concluded that the Adapter pattern positively impacts maintainability, reducing indicators such as the number of methods and lines of code and improving cohesion.

Qasim (2021) investigated the impact of using different design patterns on the energy consumption of Android applications. The authors implemented five patterns (Singleton, Facade, Observer, Template, and Abstract Factory) in two open source applications, measuring energy consumption before and after implementation. The results showed that patterns like Observer and Abstract Factory significantly reduced energy consumption, while Singleton, on the other hand, caused an increase.

Excessive engineering

However, the mere use of a design pattern does not guarantee the suggested improvements. In general, research on the impact of design patterns on software quality presents mixed and contradictory results, suggesting that the relationship between design patterns and software quality is complex and influenced by several factors. In fact, there are studies pointing out that some patterns can have a negative impact on software quality.

In parallel, some developers, especially less experienced ones, may try to apply design patterns in situations where simpler solutions would suffice, a problem known as over-engineering.

A negative impact on productivity can also occur if a pattern is poorly utilized, adding excessive complexity and hindering comprehension, which can make modifications to the code more difficult. The implementation of “straightforward” patterns, that is, without adapting them correctly to the context of the application, can generate inefficient solutions.

There is a lack of empirical studies that evaluate the impact of design patterns on software quality, and many studies rely on questionnaires. Thus, it is difficult to analyze and adopt a given design pattern based on research and tools.

How to choose

So, how to choose the most suitable design pattern? This choice should be made taking into account several factors. First, it is necessary to identify exactly what the problem is that one intends to solve through a pattern. Design patterns are solutions for recurring problems, therefore, we must check if the part of the software to be standardized can be identified as a recurring problem.

Only after this step should the intent of each pattern be analyzed, that is, the particular type of problem that each pattern can solve. It is also necessary to consider the consequences and trade-offs that the chosen design pattern will bring to the development and the team. The selected pattern should facilitate communication among team members, not hinder it. Therefore, it is also important to consider the familiarity that the team has with the patterns.

As design patterns are ready-made solutions, it may be necessary to adapt them to the context of the problem, in order to obtain the best relationship between the implementation cost and the benefits that the solution will bring to the project. After all, design patterns were conceived to improve code quality; otherwise, it is better to define the implementation itself, in a simplified way, seeking to guarantee the same quality parameters.

In order to evaluate the impact and quality improvement of the software, some metrics can be calculated before and after a refactoring for the use of a certain design pattern. Some indicators, such as the Maintainability Index, Class Coupling and Cohesion, and even Execution Time, can be relevant to evaluate the benefits of adopting the design pattern in question. However, it can be very difficult to obtain these metrics to perform this more careful evaluation.

Design patterns are not the “silver bullet” for all types of problems. It is important to analyze the situation very well before using them in any software project, to verify if they will bring significant advantages. First, one must evaluate the real need to adopt them in the project.

Often, a good balance can be achieved by developing simpler code, without following a specific pattern, and then refactoring it to use some design pattern, avoiding some implementation issues. Using metrics and the team’s general perception, it will be possible to evaluate whether the use of the pattern after refactoring has improved code quality and brought benefits to everyone.

Regardless of the above, it is important that every developer learns about design patterns, to be able to identify them and contribute more easily to different open source projects, for example. Learning more about these patterns expands the horizons and allows the developer to find new ways to solve problems and propose improvements in existing systems, creating much higher quality software.

To access the references of this text click here.

This content was produced by:

Lucas Schiolin Silveira

LinkedIn

Graduated in Computer Science from Unesp Rio Claro, holds an MBA in Data Science and Analytics from USP/ESALQ. Works as a developer and technical leader at Skylar. Is a student of AI, Machine Learning and Data Science.

Who wrote this column

Skylar

"Startup" de tecnologia e legendagem que faz parte das iniciativas do Pecege, utiliza inteligência artificial e técnicas linguísticas para fazer legendagem em tempo real. Atuante nas áreas de educação, eventos, agronegócio, tecnologia, saúde, entretenimento e esportes, entre outras. Acesse o site!

You may also like

October 02, 2026

Determinants of supermarket location in São Paulo

A study investigated the determining factors for supermarket location in the state of São Paulo, with the objective of investigating the factors that explain the presence and expansion of these establishments, considering socioeconomic, demographic, and market dimensions. Data from the 2010 and 2022 Demographic Censuses of IBGE and information from the National Registry of Legal Entities of the Federal Revenue of Brazil were used to build a georeferenced database. A Random Forest classification model was applied, adjusted by grid search with cross-validation, prioritizing the recall-macro metric due to the imbalance of the dependent variable, which represented the presence or absence of supermarkets within a 50-meter buffer. The results indicated that supermarket location is strongly associated with demographic, income, and population characteristics in the surrounding area. The analysis of variable importance showed that sociodemographic factors, such as elderly literacy, household income, and the presence of other food establishments, exerted significant influence, especially in the immediate vicinity. The findings reinforced the hypothesis that the spatial distribution of supermarkets is not random, being conditioned by socioeconomic characteristics and the commercial structure of the territory, offering subsidies for business decisions and urban planning.

Keywords: Spatial Analysis; Machine learning; Expansion; Commercial location; Supermarkets.

Neuroscience And Learning In Education

October 02, 2026

Anti-Racist Education: Inclusive Educational Practices and Social Development

Antiracist education, understood as a structuring axis of inclusive education and social development, was investigated in the Brazilian context. The study aimed to identify and analyze, based on legal documents and teachers’ perceptions, educational practices capable of promoting antiracism in school and society, and how the implementation of Laws nº 10.639/03 and nº 11.645/08 contributed to social justice. A qualitative and documentary approach was adopted, with analysis of educational legislation, curricular guidelines, institutional reports, and academic literature. Complementarily, a semi-structured questionnaire was applied to 295 Basic Education teachers. The data were evaluated quantitatively and qualitatively, through thematic content analysis, and validated with bibliographic studies. The results revealed a paradox: despite a robust legal framework, the implementation of antiracist policies proved fragile and sporadic, with a lack of teacher training, adequate teaching materials, and monitoring. Significant educational inequalities between white and black students were found to persist, and most teachers acknowledged the occurrence of racism in schools, but without clear institutional protocols. Neuroscientific analysis showed that racism negatively impacts students’ cognitive and emotional development. It was concluded that antiracist education is central to quality education, requiring political commitment, public investment, and intersectoral articulation. The integration of Neuroscience in teacher training and the production of qualified materials are crucial to strengthen the school’s role in building a more just and inclusive society.

Keywords: Social Development; Antiracist Education; Social Justice; Law 10.639/03; Inclusive Educational Practices.

Neuroscience And Learning In Education

October 02, 2026

Paths of Inclusion: Perceptions of Parents and Teachers on the Schooling of Students with Dual Exceptionality in the Brazilian Context

Dual Exceptionality, characterized by the coexistence of High Abilities/Giftedness and neurodevelopmental disorders, represents a complex phenomenon that challenges traditional identification and schooling models. The study aimed to understand the perceptions of parents or guardians, teachers, and other education professionals regarding the schooling of students with Dual Exceptionality in the Brazilian context, investigating challenges, pedagogical strategies, and possibilities for inclusion based on equity. The research adopted a qualitative, exploratory, and descriptive approach, and collected data through an online, voluntary, and anonymous questionnaire answered by 25 participants. Discursive data were analyzed using thematic content analysis. The results indicated that knowledge about the topic is often built from personal and professional experiences, revealing gaps in systematic training. Difficulties were identified in identifying these students, in teacher training, and in implementing individualized educational plans, pedagogical flexibility, and curriculum enrichment. Socio-emotional repercussions, such as frustration and low self-esteem, were reported. However, some schools demonstrated inclusive practices based on equity, articulating specific needs and potentialities. Although the results do not allow for generalizations, they highlighted the need to strengthen professional training and the articulation between school, family, and specialized services. It was concluded that the inclusion of students with Dual Exceptionality requires practices that simultaneously recognize their difficulties and potentialities, ensuring equitable conditions for participation, learning, and development.

Keywords: Human development; Teacher training; School inclusion; Neurodivergence; Pedagogical practices.

October 02, 2026

Data Transformation into Strategy: Applied Research for Ecotourism Operation Optimization

The growing demand in ecotourism in Minas Gerais has driven the search for business intelligence to transform customer data into strategic information. The study aimed to structure a data science pipeline to collect, segment, and classify the customer base of an ecotourism operation, in order to optimize marketing actions and anticipate market movements. An exploratory, quali-quantitative research was conducted through a case study. 2,777 transactional records from an ecotourism company, referring to January 2024 to December 2025, were used. The methodological process involved automated data collection (Google Sheets API), processing and enrichment (ETL), validation, and creation of RFM (Recency, Frequency, and Monetary Value) attributes. Dimensionality reduction via PCA and K-Means clustering was applied, with the number of clusters defined by the Elbow method and Silhouette Score. The results were validated with DBSCAN and K-Medoids. The results revealed the identification of three behavioral customer segments: “Loyal”, “Low Value”, and “Potential”. The “Loyal” segment represented the highest accumulated economic value, while the “Potential” segment stood out for its high average ticket and potential for conversion into recurrence. The integration of data analysis techniques proved to be a robust and replicable method for generating intelligence in ecotourism. It was concluded that the structured data science pipeline enabled the behavioral segmentation of the customer base, the statistical validation of the groups, and the creation of a predictive system for new buyers, providing subsidies for data-driven strategic decisions and future analyses.

Keywords: Clustering; Business intelligence; Machine Learning; Customer segmentation; Decision making.

October 02, 2026

Classification of defaulting customers using supervised machine learning techniques

The risk of default in credit operations demanded analytical approaches to anticipate losses. This study comparatively evaluated the performance of supervised machine learning models in classifying defaulting customers in credit card operations. The public dataset “Default of Credit Card Clients” from the University of California Irvine was used, with 30,000 observations and class imbalance. The algorithms Logistic Regression, Random Forest, and Extreme Gradient Boosting were employed. The imbalance was addressed by assigning weights to the classes, and model optimization occurred with the RandomizedSearchCV method, prioritizing sensitivity. Cross-validation results indicated that the Extreme Gradient Boosting model showed a higher capacity for identifying the defaulting class and better discriminatory performance, followed by Random Forest and Logistic Regression, with a sensitivity of 0.8250 and an AUC-ROC of 0.7844 for XGBoost. Interpretability analysis, conducted by the Shapley Additive Explanations (SHAP) technique, highlighted the predominance of variables associated with payment behavior, especially the history of delays. It was concluded that tree-based models, particularly boosting techniques, proved to be more suitable for capturing complex patterns in the data, configuring themselves as consistent alternatives for credit risk management.

Keywords: Machine Learning; Credit Card; Classification; Extreme Gradient Boosting; Credit Risk.

October 02, 2026

Sentiment Analysis on Brazilian Banks on Twitter/X: Comparison between Traditional and Digital Institutions

A study analyzed public perception of Brazilian financial institutions on the Twitter/X platform, highlighting the importance of sentiment monitoring on social networks for understanding reputation and customer experience in the banking sector. The objective was to compare user perception of the image and reputation of traditional and digital banks, based on the sentiment patterns identified in the analyzed manifestations, seeking to identify structural differences between these groups. The methodology was based on the analysis of 1,096 tweets collected between November 2022 and June 2023. Two complementary sentiment analysis approaches were used, the sum and the average of labels, to capture the majority sentiment and nuances of perception. Additionally, the Market Profile Model, with indicators of emotional reputation, reputational risk, neutrality, and polarization, and the Banking Clustering Model, which allowed grouping institutions according to perception patterns, were developed. The results indicated a predominance of neutral and negative sentiments, a higher volume of interactions in digital banks, and structural differences in the emotional intensity of perceptions, with greater stability in digital banks and greater polarization in traditional ones. It was concluded that the combination of analytical and statistical techniques contributed to an in-depth understanding of institutional image in the digital environment, demonstrating the importance of data-driven reputation management strategies.

Keywords: Digital banks; Traditional banks; Data modeling; Opinion mining; Social Networks.

October 02, 2026

Optimization of annual budget planning through project management methodologies

The Annual Budget Planning (POA) is a crucial process for translating organizational strategy into operational and financial goals, but it frequently faces deadline pressures, interdepartmental dependencies, and the repetition of habitual expenses. The study aimed to analyze how the combined application of project management practices and Zero-Based Budgeting (OBZ) can optimize the POA. To this end, a case study was developed in the Brazilian operation of a publicly traded company in the beverage sector, using documentary research of its 2023 results report and an anonymous questionnaire applied to 47 respondents. Documentary analysis indicated growth in net revenue, expansion of gross profit and adjusted EBITDA, and contained advancement of selling, general, and administrative expenses, suggesting cost discipline and operational leverage. The complementary survey revealed a high perception of cascading effect on the schedule, strong support for defining cost package owners, and a preference for technical justification of expenses, in addition to demand for controlled flexibility after the baseline definition. It was concluded that structuring the POA as a project, associated with the rigor of OBZ, increased the process predictability, reinforced accountability for expenses, and broadened the coherence between budgetary execution and economic-financial performance.

Keywords: Cost Control; Operational Efficiency; Zero-Based Budgeting; PMBOK; Beverage Sector.