Dabaoshi
Author

Dabaoshi

Practical utilities

49
Articles
0
Likes
24
Views
0
Comments
Recent Articles

Latest from Dabaoshi

49 recent articles
Dabaoshi
Dabaoshi
Aug 6, 2026 · Fundamentals

Facade Pattern: Simplify Complex Subsystems with a Unified Interface

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.

Design PatternsFacade PatternJava
0 likes · 14 min read
Facade Pattern: Simplify Complex Subsystems with a Unified Interface
Dabaoshi
Dabaoshi
Aug 6, 2026 · Fundamentals

Design Pattern #10 – Composite Pattern: Organizing a Group of Objects

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.

Composite PatternDesign PatternsJava
0 likes · 14 min read
Design Pattern #10 – Composite Pattern: Organizing a Group of Objects
Dabaoshi
Dabaoshi
Aug 6, 2026 · Fundamentals

Design Patterns 09 – Adapter Pattern: Connecting Incompatible Interfaces

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.

AdapterClass AdapterDesign Patterns
0 likes · 14 min read
Design Patterns 09 – Adapter Pattern: Connecting Incompatible Interfaces
Dabaoshi
Dabaoshi
Aug 5, 2026 · Fundamentals

Understanding the Decorator Pattern: Dynamic Runtime Enhancements with Java 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.

CompositionDecoratorDesign Patterns
0 likes · 16 min read
Understanding the Decorator Pattern: Dynamic Runtime Enhancements with Java Examples
Dabaoshi
Dabaoshi
Aug 5, 2026 · Fundamentals

Proxy Pattern Explained: Static, JDK Dynamic, and CGLIB Implementations

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.

CGLIBDesign PatternsDynamic Proxy
0 likes · 17 min read
Proxy Pattern Explained: Static, JDK Dynamic, and CGLIB Implementations
Dabaoshi
Dabaoshi
Aug 5, 2026 · Fundamentals

Prototype Pattern: The Final Creational Design Pattern Explained

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.

CloneableDeep CopyDesign Patterns
0 likes · 18 min read
Prototype Pattern: The Final Creational Design Pattern Explained
Dabaoshi
Dabaoshi
Aug 5, 2026 · Fundamentals

Builder Pattern in Java: Clean, Immutable Construction for Complex Objects

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.

Builder PatternDesign PatternsImmutable
0 likes · 20 min read
Builder Pattern in Java: Clean, Immutable Construction for Complex Objects
Dabaoshi
Dabaoshi
Aug 5, 2026 · Fundamentals

Abstract Factory Pattern: Building Whole Product Families, Not Just Single Products

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.

Abstract FactoryDesign PatternsFactory Method
0 likes · 17 min read
Abstract Factory Pattern: Building Whole Product Families, Not Just Single Products
Dabaoshi
Dabaoshi
Aug 4, 2026 · Fundamentals

Factory Method Pattern: Deciding Which Variant to Create

This article walks through the evolution from direct object instantiation to Simple Factory and finally to the Factory Method pattern, explaining why scattering new statements is problematic, how Simple Factory centralizes creation but still violates the Open/Closed principle, and how the Factory Method delegates the decision to specialized factories, complete with code examples, role definitions, and guidance on when to apply each approach.

Design PatternFactory MethodJava
0 likes · 16 min read
Factory Method Pattern: Deciding Which Variant to Create
Dabaoshi
Dabaoshi
Aug 2, 2026 · Fundamentals

Master the Seven Design Principles Before Tackling Design Patterns

The article explains that design patterns rely on solid design principles—SRP, OCP, LSP, DIP, ISP, LoD, and CARP—using a flawed order‑processing example to show each principle, how to refactor the code, and why over‑engineering must be avoided.

Design PrinciplesJavaObject-Oriented Design
0 likes · 24 min read
Master the Seven Design Principles Before Tackling Design Patterns