This article breaks down the software architect role into three architecture levels, nine daily activities, and ten essential skills—including design patterns, decision-making frameworks, simplification principles, and hands-on coding—with references to GoF patterns, enterprise integration patterns, ThoughtWorks Tech Radar, and TOGAF.
The article demonstrates how the Decorator Pattern solves coupon stacking, order sensitivity, and class explosion problems in e-commerce by composing discount calculators recursively, with Java implementation examples and real-world JDK/Servlet references.
Class ExplosionComposition Over InheritanceCoupon System
This tutorial demonstrates how to refactor a 16-branch if-else chain in a Spring Boot order service using the Strategy Pattern, showing interface definition, strategy implementations, auto-registration via Spring's List injection, factory pattern for O(1) lookup, and common pitfalls to avoid.
This article demonstrates how to implement the Strategy Pattern combined with a Simple Factory in Spring Boot to handle multiple business callbacks through a single interface, enabling easy extension without modifying existing code.
This tutorial demonstrates implementing the Strategy Pattern in Spring Boot using a calculator example, showing how to register strategy beans via @Component, inject them into a factory map at startup, and route requests dynamically for extensible callback handling without modifying existing code.
This article details ten core microservices design patterns — including Database per Service, Event Sourcing, CQRS, Saga, BFF, API Gateway, Strangler, Circuit Breaker, Externalized Configuration, and Consumer-Driven Contract Testing — with pros, cons, use cases, and technology examples for each.
This article demonstrates how moderate CSS overlap between an environment heading and artifact card creates visual hierarchy to highlight key release information, while providing fallback layouts for long content and narrow screens to prevent clipping.
This article systematically categorizes and explains core microservice design patterns across decomposition, integration, database, event-driven, observability, and cross-cutting concerns, providing practical guidance for architects building resilient, scalable distributed systems.
The article explains why process orchestration is essential for backend systems serving multiple business lines, demonstrating a flow engine with process, success, rollback, and callback nodes that eliminates if-else chains, ensures code isolation, and enables safe extension, with code examples and a Git repository reference.
Chain of ResponsibilityDesign PatternsMulti-tenancy
This tutorial demonstrates static proxy (decorator pattern), JDK dynamic proxy (interface-based), CGLIB dynamic proxy (subclassing), and Spring AOP's dual-proxy implementation with @EnableAspectJAutoProxy, using an EmployeeService example that adds C# and Go skills without modifying original code.
This tutorial explains the Observer design pattern with a Java implementation using an e-commerce order system where payment triggers logistics and procurement updates, demonstrating loose coupling between subject and observers.
This article explains the Chain of Responsibility design pattern with a practical Java example of a leave approval workflow, showing how it decouples request senders from receivers and enables flexible, extensible handling through a chain of handlers.
The final day of the HarmonyOS Meta Service 7-Day Tour explores a Code Lab meta service that visualizes sorting algorithms, data structures, and design patterns with synchronized step-by-step playback, pause, rewind, and code highlighting driven by a shared playback model.
This comprehensive guide covers creational, structural, and behavioral design patterns with Java code examples, Spring framework source code analysis, and common interview pitfalls, enabling developers to move beyond rote memorization to deep understanding.
A senior Java engineer recounts how a team evolved from a MyBatis interceptor for environment-based data isolation to a clean annotation-plus-AOP solution after a junior developer's ThreadLocal-based quick fix caused nested-call bugs and scattered boilerplate across the codebase.
The article shows a Java if-else chain that applies different discounts and actions based on user type, then asks which design pattern can refactor it into more elegant code.
A humorous yet practical deep-dive into legacy code horrors — meaningless names, 7-level nesting, 1200-line god methods, magic numbers, and copy-paste duplication — followed by a four-step refactoring playbook (understand, extract, name/comment, optimize) and team-level prevention tactics like code reviews, coding standards, and offboarding rituals.
This article introduces ADPS, a dual-axis framework for agent design patterns combining seven cognitive functions with six execution topologies, distilled from seven expert workshops across major tech companies, providing 28 production-verified patterns to guide agent engineering from perception to governance.
This article explains the Java Adapter design pattern, covering its definition, roles (Target, Adapter, Adaptee), and two implementation approaches—class adapter using inheritance and object adapter using composition—with complete code examples for each.
The article demonstrates how to correctly apply the DRY principle by refactoring seven duplicated notification service classes in Spring Boot 3.5.0 using the template method pattern and a NotificationMessage value object, consolidating 40 lines of repeated validation, logging, and error handling into a single abstract base class.
This article provides a comprehensive explanation of the Java Decorator pattern, covering its definition, purpose, advantages, disadvantages, and a complete implementation example with four key roles and runnable code demonstrating dynamic behavior extension.
This article explains Java callback mechanisms — synchronous and asynchronous — through interfaces, anonymous classes, lambdas, and CompletableFuture, demonstrates their use in Spring's BeanFactory and a payment integration, and shows how functional interfaces enable flexible data transformation for multi-bank integration.
The article explains the Open‑Closed Principle, shows how Spring leaves empty hook methods like onRefresh() for extensions, demonstrates the concept with a Java demo, compares inheritance‑based and interface‑based extension approaches, and discusses trade‑offs and practical guidelines for designing extension points.
The article breaks down five concrete design patterns in DeepSeek Harness—session logs as truth, repeat‑tool reminders, output retention, Code Mode governance, and Workspace for long‑term state—showing how the framework shifts agent development from pure model tricks to a full‑featured runtime system.
The article wraps up the "Design Pattern Dissection" series by showing how the 23 GoF patterns appear in JDK, Spring and MyBatis, clarifying the most confusing pattern pairs, warning against over‑design, and presenting a comprehensive map that links each pattern to the seven core design principles.
This article examines the three least‑used behavioral design patterns—Mediator, Visitor, and Interpreter—by explaining the problems each solves, showing core implementations with order‑page examples, highlighting their narrow applicability, common pitfalls, and why developers should often steer clear of them.
The article explains how the Command pattern encapsulates a request as an object, enabling storage, queuing, undo/redo, and decoupling between request senders and executors, with concrete Java examples and guidance on when the pattern is appropriate.
The article demonstrates how to combine SpringBoot with the Strategy pattern and a simple factory to route different business operations—add, subtract, multiply, divide—through a single API, registering strategy beans in a map for easy extension without modifying existing code.
The article explains why simply using a smarter model isn’t enough, showing that applying four fundamental AI‑agent design patterns—Reflection, Tool Use, Planning, and Multi‑Agent Collaboration—can raise GPT‑3.5’s HumanEval success from 48 % to over 95 %, and outlines how each pattern works, their trade‑offs, and practical implementation guidance.
The article explains how the Strategy design pattern solves the maintenance nightmare of tangled if‑else or switch statements by extracting each algorithm into its own strategy class, detailing the roles, selection mechanisms, Java examples, and when the pattern is appropriate.
The article explains how the Bridge design pattern separates two orthogonal dimensions—such as order type and notification channel—into independent hierarchies, replacing inheritance‑driven class explosion with compositional bridges, and demonstrates its rationale, code, real‑world examples, and differences from similar patterns.
Bridge PatternComposition Over InheritanceDesign Patterns
This article breaks down seven practical software‑architecture patterns—Bounded Context, Sidecar, Publisher‑Subscriber, Application Gateway, Microservices, Micro‑frontends, and CQRS/Event Sourcing—showing how they can be combined in a real e‑commerce system and guiding architects on when each pattern best solves complexity, performance, or team‑collaboration challenges.
The article critiques five common C++ misconceptions—overusing OOP, treating books as a coding substitute, obsessing over advanced language features, indiscriminately applying templates, and needlessly allocating small objects on the heap—using concrete game‑dev examples and detailed reasoning.
The article explains how the Facade design pattern hides the intricacies of multiple subsystems—such as inventory, payment, logistics, and notification—behind a single, easy‑to‑use class, illustrating the problem, solution, code examples, relation to the Law of Demeter, real‑world usages, and common pitfalls.
The article explains how the Composite pattern solves the pain of handling tree‑like structures—such as orders with nested packages—by providing a uniform component interface that eliminates instanceof checks, discusses transparent vs safe variants, shows real‑world library examples, and outlines when the pattern is appropriate.
Adapter pattern acts as a translation layer that lets existing classes with mismatched interfaces interoperate without modification, illustrated through a logistics API integration example, with detailed object and class adapter implementations, trade‑off analysis, standard library and Spring examples, and a comparison with decorator and proxy patterns.
The article explains Go's zero‑value concept, why every variable gets a deterministic default, provides a complete table of zero values for basic and composite types, shows how standard library types are "zero‑value useful", demonstrates designing your own zero‑value-friendly types, and discusses nil semantics, new vs make, and common pitfalls with practical code examples.
The article explains the Decorator pattern, showing how it dynamically adds functionality to objects without modifying them or using inheritance, using an order pricing example and Java IO streams, compares it with inheritance and Proxy, and outlines when to apply decorators effectively.
This article introduces the structural Proxy pattern, demonstrates three implementations—hand‑written static proxy, JDK dynamic proxy, and CGLIB subclass proxy—explains their mechanisms, trade‑offs, and limitations, and shows how Spring AOP selects between them for cross‑cutting concerns like logging, transactions, and caching.
The article explains the Prototype design pattern, showing how cloning existing objects can replace costly object construction, details Java’s Cloneable and clone() mechanisms, the pitfalls of shallow copying, and various deep‑copy techniques such as manual recursion, serialization, and library utilities.
The article explains why traditional telescoping constructors and JavaBean setters fail for objects with many optional fields, and demonstrates how the Builder pattern—both the simplified static inner class version and the full GoF version with a Director—provides readable, step‑by‑step assembly, mandatory validation, and immutable results, with guidance on when to apply it.
The article explains the Abstract Factory pattern by contrasting product families with product hierarchies, showing why the Factory Method fails for bundled products, presenting the pattern's structure and code, and detailing its open‑closed principle tilt and appropriate usage scenarios.
The article examines four microservice architecture designs—shared‑database, aggregation, proxy (gateway/BFF), and asynchronous messaging—detailing their structures, advantages, drawbacks, and ideal use cases such as e‑commerce order processing, high‑concurrency systems, and gradual migration scenarios.
This article presents a curated reading list for software architects, organized by career stages and covering design patterns, code quality, architecture, distributed systems, cloud‑native topics, along with reading principles, recommendations, and a top‑10 book ranking to guide continuous learning.
The article shows that Scala’s built‑in object keyword lets you create a singleton with a single line, contrasts this with Java’s multi‑line implementation, explains why design patterns exist, and discusses when and how to use them responsibly.
This article introduces the Observer pattern, explains its purpose of decoupling publishers and subscribers, walks through a complete Java implementation with an official‑account subscription example, lists typical business scenarios, compares it with the Mediator pattern, and outlines its advantages and pitfalls.
This article provides an in‑depth technical analysis of Agent Skills, detailing the official specification, three‑layer progressive loading mechanism, engineering workflow of Skill‑Creator, naming and description rules, evaluation agents, practical advantages, known limitations, and five reusable design patterns for building robust AI agent capabilities.
Day 21 ties together six software‑engineering pillars—development models, requirements engineering, UML, design principles & patterns, testing, and CMMI—explains their interrelations, illustrates them with an e‑commerce order‑system case, teaches a memory‑palace recall method, and provides a 20‑question exam with answers.
The article explains why memorizing design pattern names is insufficient, introduces core design principles (SRP, OCP, LSP, DIP, ISP, LoD), and walks through seven high‑frequency patterns—Singleton, Factory, Adapter, Decorator, Proxy, Observer, and Strategy—using an evolving order‑processing system to show how each pattern addresses changeability and extensibility.
The article explains why the guideline “favor composition over inheritance” is useful but not absolute, illustrates a fixed‑workflow scenario where inheritance simplifies implementation, and provides concrete code examples and decision criteria for choosing between the two approaches.
The article reviews the arXiv paper on MCP Server architecture, presenting five reusable design patterns and four anti‑patterns, explains the research methodology, shares concrete code examples, and quantifies how tool count affects LLM selection accuracy, offering practical guidelines for building robust MCP Servers.
The article argues that early extensibility design should be driven by concrete industry certainty—such as established multi-system integration patterns, clear product roadmaps, or repeated historical changes—rather than speculative future needs, illustrating the approach with chain-store integrations, payment channels, and marketing rules.
The article argues that true object‑oriented design is about controlling software dependencies, tracing its historical roots from Simula to Smalltalk and C++, illustrating how polymorphism, composition, and proper dependency inversion solve real‑world problems while warning against over‑engineered OO patterns.
This article walks through eight essential design patterns—Factory Method, Prototype, Adapter, Decorator, Observer, Strategy, Template Method, and Chain of Responsibility—showing concrete Spring Boot 3.5.0 code examples, explaining the problems each pattern solves, and highlighting their practical advantages for clean, extensible backend development.
This article catalogs twenty high‑frequency loop architectures that transform single‑call AI models into autonomous, self‑optimising agents, explaining each pattern’s purpose, workflow, concrete code example, and typical commercial scenarios such as content creation, compliance review, and strategic decision making.
The article presents twenty essential loop design patterns for industrial AI systems, explains how they differ from single‑call prompts, provides concrete examples, code snippets, and use‑case scenarios, and shows how these loops enable self‑improvement, memory, planning, exploration, and system optimization for AI agents.
This article demystifies the Iterator design pattern by describing its purpose of separating collection storage from traversal, illustrating everyday analogies, presenting a complete Java implementation—including interfaces, concrete aggregate, custom iterator, and test code—and summarizing typical applications, advantages, and drawbacks.
This article explains Spring Integration’s core concepts—messages, channels, endpoints, adapters, filters, and transformers—shows how to configure them with XML or Java, compares the framework to traditional middleware, and provides a complete e‑commerce order‑processing example with code snippets and interceptor techniques.
This article introduces the Interpreter design pattern, explains its core concept of splitting custom syntax into expression objects, showcases practical Java implementations for arithmetic, and outlines typical use cases such as calculators, rule engines, and low‑code platforms while discussing its advantages and drawbacks.
This article details the design of an e‑commerce pricing engine that processes shopping‑cart items and multiple promotional activities through a three‑stage workflow, copy‑on‑trial execution, configurable Aviator rule chains, and a two‑phase discount sharing algorithm, with code examples and engineering considerations.
This article introduces the Command pattern, describing how encapsulating each action as a command object decouples callers from executors, and demonstrates its use through real‑world examples like remote controls and editors, followed by a complete Java implementation, common business scenarios, and a brief pros‑cons analysis.
This article systematically explains 23 fundamental design patterns—creational, structural, and behavioral—detailing their intent, typical use cases, and concrete examples such as Singleton for configuration managers, Factory Method for transport logistics, Builder for house construction, and many more, helping readers master pattern selection and application.
The article explains how the Template Method pattern pervades Spring’s core classes—such as JdbcTemplate, AbstractApplicationContext, and various *Template classes—by fixing the overall algorithm flow while delegating the variable steps to subclasses, and contrasts it with the Strategy pattern.
This article introduces the Proxy design pattern, explains its core purpose of controlling access without modifying original classes, illustrates everyday analogies, provides a complete Java static‑proxy implementation with interface, real subject, proxy and test code, and summarizes common use cases and distinctions from decorators.
The article examines how to regulate AI's visibility in products by applying a tiered interaction model, defining clear boundaries, and dynamically adjusting response intensity based on user intent and confidence, illustrated with real‑world examples such as Microsoft’s Clippy and data‑dashboard scenarios.
This article explains the Facade design pattern, illustrates everyday and software scenarios such as hotel front desks and multimedia players, provides a complete Java implementation with subsystem classes, a facade class, and client code, and lists typical business use cases while warning against common misconceptions.
This article walks through the three core behavioral design patterns—Strategy, Observer, and Chain of Responsibility—explaining their intent, showing problematic anti‑patterns, providing step‑by‑step Spring and MQ code implementations, mapping them to real‑world frameworks, and offering interview‑style comparison questions to solidify understanding.
The article introduces the Decorator pattern, explains its purpose of dynamically adding functionality without altering existing classes, illustrates the concept with everyday analogies and a complete Java milk‑tea example, and lists typical use cases and common pitfalls.
This article explains the four essential structural design patterns—Proxy, Decorator, Adapter, and Facade—detailing their core concepts, real‑world Java/Spring use cases, code implementations, and interview‑focused comparisons to help developers master enterprise‑level architecture.
This article introduces the Composite design pattern, explains its purpose of treating leaf and container objects uniformly, shows typical tree‑structured use cases, and provides a complete Java implementation with abstract component, leaf, composite, and a test demo.
This article explains why telescoping constructors and JavaBean setters are problematic, demonstrates a hand‑written Builder implementation based on Effective Java, shows how Lombok @Builder simplifies code, and warns about two common Lombok pitfalls—default values and inheritance—while offering practical solutions.
Learn how to replace sprawling if‑else logic in payment gateways and SaaS platforms by combining the Strategy and Factory patterns, with concrete Spring Boot examples, step‑by‑step code, and a progression from simple to abstract factories that enforce the Open‑Closed principle.
This article introduces the Prototype design pattern, explains its purpose of cloning existing objects to avoid costly construction, illustrates practical scenarios such as product templates and game asset generation, provides a complete Java shallow‑copy example, and highlights common pitfalls and differences from the Factory pattern.
The article explains why indiscriminate use of the Java new operator leads to duplicated configuration, hidden complexity, and performance problems, and demonstrates how Factory, Builder, Object‑Pool, and Prototype patterns—illustrated with Spring Boot 3.5.0 code—provide clean, maintainable alternatives that distinguish junior from senior developers.
This article introduces the Builder design pattern, illustrates its concept with everyday analogies like milk‑tea making, and provides a complete Java example that assembles a computer through step‑by‑step builders, followed by a summary of typical business use cases and a tip on avoiding confusion with the Factory pattern.
The article explains how the Abstract Factory pattern creates whole families of related objects—contrasting it with the Factory Method—illustrates practical scenarios such as phone accessories, UI themes, and payment suites, provides step‑by‑step Java code, lists common use cases, and discusses its limitations.
This article presents a comprehensive, mobile‑friendly catalog of 23 classic design patterns, organized into Creational, Structural, and Behavioral groups, offering clear names and categories that developers can copy and use as a quick reference for learning and applying design patterns.
The article argues that building AI Agent Skills follows a nascent methodology built on three scientific principles—In‑Context Learning, attention distribution, and bounded rationality—organized into three methodological streams (design‑driven, engineering‑driven, auto‑optimization) and distilled into six reusable design patterns, with a roadmap for future evolution.
The article explains seven AI agent design patterns—workflow, routing, parallel, loop, aggregation, network, and hierarchy—illustrates their use with concrete examples and code, compares agent frameworks such as AutoGPT, Dify, AutoGen, CrewAI and LangGraph, and shows why multi‑agent architectures outperform traditional workflows in complex operational tasks.
The article explains how an e‑commerce platform’s settlement module can use the Strategy pattern to cleanly handle varied fee calculations for group‑buy, flash‑sale, special‑price and full‑discount promotions, avoiding tangled if‑else logic and simplifying future extensions.
The article breaks down twelve reusable Agentic Harness design patterns extracted from Claude Code, grouping them into memory, workflow, tool‑permission, and automation categories, explains the architectural pain points each solves, shows when to apply or over‑engineer them, and provides concrete Python implementations.
Most Java developers treat enums as simple constant lists, but modern frameworks like Tomcat, Spring Boot, and RocketMQ exploit enums for state machines, strategy patterns, lambda‑driven behavior, lightweight DSLs, and more, dramatically reducing boilerplate and improving type safety.
The article explains that software architecture is fundamentally about trade‑offs, categorises major architecture families such as DDD, Clean/Hexagonal/Onion, Microservices vs SOA, CQRS/Event Sourcing, MVC, PACELC, BASE, FLP, Repository and 12‑Factor principles, and shows how each addresses specific constraints to help engineers pick the most suitable design for their context.
This article expands the SOLID principles into a three‑layer framework—class, pattern, and component levels—clarifying common misinterpretations, presenting correct definitions with concrete examples, and showing how GRASP and design patterns operationalize these principles for stable, low‑coupling software.
Even after spending hours crafting a Skill, many LLM agents ignore it, leading to failed automation; this article analyzes why and presents five validated design patterns—linear flow, decision tree with lazy loading, iterative loops, baton passing, and multi‑stage checkpoints—plus concrete examples and a minimal Skill template to ensure reliable, production‑grade agent behavior.
The article breaks down six common agentic AI design patterns—Single Agent, Sequential Agents, Parallel Agents, Loop & Critic, Coordinator & Sub‑agents, and Sub‑Agents as Tools—detailing their implementation structures, strengths, weaknesses, and ideal application scenarios, helping practitioners choose the right architecture for scalable LLM workflows.
The article shows that interviewers don’t just want you to list design patterns; they assess your ability to identify real scenarios, solve concrete problems, justify trade‑offs, and discuss implementation details, illustrated with payment and order‑processing examples in Java and Spring.
Chain of ResponsibilityDesign PatternsFactory Pattern
This article explains five practical design patterns—tool wrapper, generator, reviewer, inversion, and pipeline—for structuring AI agent SKILL.md files, showing when to use each, how they work internally, and how they can be combined for robust, maintainable agent behavior.
The article dissects Claude Code’s tool architecture, showing how a single generic triple (Input, Output, Progress) defined in src/Tool.ts unifies over 60 runtime tools, enforces type‑safe contracts, streamlines permission checks, progress reporting, and implements a fail‑closed default strategy.
The article traces the fictional rise and fall of design patterns from their 1994 debut, through a golden era of OOP and interview hype, to their eclipse by modern language features and AI‑generated code, ending with AI agents unintentionally reinventing the same abstractions.
This article provides a comprehensive, step‑by‑step template for a high‑scoring system architecture design paper, detailing project background, challenges, six‑stage ABSD design, microservice migration with Spring Cloud Alibaba and Kubernetes, performance metrics, high‑availability safeguards, and lessons learned.
The article distills Anthropic’s official skill‑authoring guide into fourteen reusable design patterns—grouped into discovery, context economy, instruction calibration, workflow control, and executable code—detailing their purpose, concrete examples, applicability, and trade‑offs for building effective Claude Agent Skills.
The article explains that difficulty reading code often stems from unfamiliar design patterns and complex construction logic rather than poor code quality, illustrating with factory and strategy patterns in inventory systems, and provides a checklist to distinguish between genuinely bad code and gaps in a developer’s knowledge.
Many developers learn dozens of design patterns but still end up with fragile, hard‑to‑maintain code; the article explains that the real key is to identify system problems first and apply a disciplined engineering decision method, illustrated with concrete Factory, Builder, Strategy, Template, Decorator, Adapter, Observer and Mediator examples.
The article distills Anthropic’s production‑agent guidance into five groups of twelve concrete MCP patterns—covering tool surface design, interaction semantics, authentication, context economy, and packaging—explaining why each pattern matters, its trade‑offs, and how it helps build safe, stable, low‑cost agent integrations.
The article explains how, after format standardization removed the bottleneck for enterprise AI agents, the real challenge shifted to internal logic design, and presents five reusable Agent Skill design patterns—Tool Wrapper, Generator, Reviewer, Inversion, and Pipeline—complete with code samples, typical use cases, and best‑practice guidelines for combining and selecting them.
Google Cloud Tech’s recent article outlines five Agent Skill design patterns, building on Anthropic’s earlier work that standardized Skill format and loading, and shows how the community is shifting from merely defining Skill syntax to engineering robust, reusable workflow structures for AI agents.
The article analyzes twelve reusable Agentic Harness design patterns extracted from the Claude Code leak, grouping them into memory & context, workflow & orchestration, tools & permissions, and automation dimensions, and explains each pattern's purpose, scenarios, and trade‑offs.
The article distills Anthropic’s official skill‑authoring guidance into fourteen reusable design patterns—grouped into discovery & selection, context economy, instruction calibration, workflow control, and executable code—explaining their purpose, trade‑offs, and practical examples for building effective Claude Agent Skills.