Tagged articles
Service Layer
74 articles · Page 1 of 1
The article defines a clear rule for placing methods in DDD aggregates: a method belongs inside the domain object only when it can operate solely on data owned by that object, illustrated with order status and marketing activity examples.
Aggregate RootDDDDomain Objects
0 likes · 4 min read

The article compares anemic and rich domain models using an order‑cancellation case, showing how setters and magic numbers in services lead to rule violations, and walks through a step‑by‑step refactor that moves business rules into the domain object for better encapsulation and consistency.
DDDDomain LogicJava
0 likes · 10 min read

The article shows how a typical three‑layer OrderService accumulates scattered business rules, mixes technical details with domain logic, lacks clear boundaries, and diverges from business language, then explains how Domain‑Driven Design reorganizes code around aggregates and bounded contexts to solve these problems while outlining when DDD is unnecessary.
DDDJavaService Layer
0 likes · 11 min read

The article explains why traditional three‑layer architectures let business logic bloat inside services, demonstrates the pitfalls of anemic domain models with a 7,000‑line SalaryService example, and shows how DDD’s rich domain model restores rule ownership and maintainability.
Anemic Domain ModelJavaService Layer
0 likes · 10 min read

This article explains unit testing fundamentals, compares unit and integration tests, introduces Mockito's core annotations and APIs, walks through a full order‑resend example with detailed test cases, and covers best‑practice methodologies, advanced techniques, common pitfalls, naming conventions, and how to run the tests.
Given-When-ThenJUnit5Java
0 likes · 21 min read

The article shows how typical Go HTTP/gRPC handlers repeat five steps of decoding, validation, type conversion, business call, and encoding, and demonstrates a generic Wrap adapter that extracts the repetitive pipeline, leaving handlers thin, type‑safe, and focused solely on business logic.
GenericsGoService Layer
0 likes · 7 min read

The article explains why returning a Result wrapper from the Service layer couples business and presentation logic, reduces reusability, complicates testing and transaction handling, and suggests keeping services pure by returning domain objects and handling errors via exceptions.
Exception HandlingJavaService Layer
0 likes · 12 min read

The article explains why a single‑module SpringBoot project becomes problematic as business complexity grows, outlines the benefits of a multi‑module architecture—including clear responsibilities, high cohesion, faster compilation, and smoother microservice migration—and provides a step‑by‑step guide with Maven configuration, module responsibilities, code examples, packaging commands, and common pitfalls.
MavenMulti-ModuleService Layer
0 likes · 15 min read

After years of piling logging, caching, and security directly into Spring Boot services, the author shows how applying the Decorator pattern—implemented via dedicated @Service beans and @Primary/@Qualifier wiring—creates a clean, extensible chain that respects the Open/Closed Principle, while outlining practical steps, trade‑offs, and pitfalls.
Decorator PatternJavaOpen/Closed Principle
0 likes · 10 min read


java1234Feb 7, 2026 · Backend Development
The article explains why returning a generic Result wrapper from a Java service layer breaks responsibility separation, harms reusability, complicates exception handling and testing, and obscures transaction boundaries, advocating for returning pure domain objects instead.
Design PrinciplesException HandlingJava
0 likes · 13 min read

The article explains that returning a Result wrapper from the Service layer mixes business logic with presentation concerns, leading to tighter coupling, reduced reusability, cumbersome error handling, harder testing, poorer DDD alignment, limited interface flexibility, and ambiguous transaction boundaries.
Exception HandlingJavaResult Wrapper
0 likes · 11 min read


SQB BlogNov 3, 2025 · Backend Development
This article describes how a company transformed its fragmented product systems into a unified, domain‑driven middle platform that supports multiple industries, detailing the architectural philosophy, modular design, service layering, template‑based modeling, and the reverse empowerment of legacy restaurant services.
BackendService Layerarchitecture
0 likes · 16 min read

While many developers add interfaces to every Service and DAO class, this article argues that with Spring’s dependency injection you can often omit them, examines common reasons for using interfaces, and proposes practical project structures and workflows for both single and multiple implementation scenarios.
Service LayerSpringbackend development
0 likes · 9 min read

This article shares a two‑and‑a‑half year effort to standardize code style and architecture across a large Java backend, detailing the origins, evolving patterns, a unified layered model, concrete implementation examples, measurable benefits, and future directions for continuous improvement.
Code styleService Layerbackend architecture
0 likes · 16 min read

This article explains the classic MVC three‑tier architecture, identifies its drawbacks such as bloated service code and long‑running transactions, and proposes adding a Manager layer to separate generic business processing, improve code maintainability, and enhance performance in Java backend systems.
JavaMVCService Layer
0 likes · 9 min read

This article examines the three classic reasons for defining interfaces on Service and DAO layers, explains why they often fall short when using Spring's dependency injection, and offers practical structuring and workflow tips for projects that may or may not require multiple implementations.
BackendService LayerSpring
0 likes · 8 min read

The article compares MySQL and PostgreSQL multi‑table join capabilities, explains why MySQL’s nested‑loop joins can be less efficient for complex queries, and discusses how decomposing joins into separate single‑table queries or moving logic to the service layer can improve performance, scalability, and caching.
Database PerformanceMySQLPostgreSQL
0 likes · 7 min read

The article examines whether a Service layer in a Spring‑based backend should be defined by interfaces, debunks common arguments for using interfaces, proposes a top‑down coding workflow, explores project structures for single and multiple implementations, and concludes that interfaces are only worthwhile when multiple implementations are required, while also containing promotional material for unrelated services.
Service Layerbackend architecturedependency-injection
0 likes · 11 min read

This article examines whether a Service layer in a Spring‑based backend should use interfaces, critiques the common justifications, proposes a top‑down coding workflow, explores AOP proxy options, and presents modular project structures for single or multiple implementations.
Service Layerbackend architectureinterface
0 likes · 10 min read

This article examines whether defining separate interfaces for Service and DAO layers is necessary in Spring projects, debunks common justifications, proposes a bottom‑up development workflow, and outlines project structures for single and multiple implementations, highlighting both benefits and drawbacks.
DAOService LayerSpring
0 likes · 8 min read

This article examines whether defining interfaces for Service and DAO layers is necessary in Spring projects, debunks common arguments for interfaces, proposes a top‑down coding workflow, and outlines strategies for handling multiple implementations without adding unnecessary abstraction.
DAOService LayerSpring
0 likes · 9 min read

This article examines whether every Service and DAO class in a Spring‑based backend should implement an interface, discusses the three traditional reasons for using interfaces, explains why they often do not hold up, and proposes practical structuring alternatives for single‑ and multi‑implementation scenarios.
DAOJavaService Layer
0 likes · 8 min read

This article examines whether a Service layer in Java Spring projects truly requires interfaces, debunking common arguments, exploring development workflows without interfaces, discussing project structuring for single and multiple implementations, and concluding when interfaces are beneficial or unnecessary.
JavaService LayerSpring
0 likes · 7 min read

The article examines MySQL's limited join types and performance drawbacks for multi‑table queries, compares them with PostgreSQL, and explains why many applications split joins into separate service‑layer operations to reduce RPC overhead, improve caching, and handle sharding constraints.
MySQLService Layer
0 likes · 7 min read

This article explains the purpose and advantages of a service layer between presentation and domain layers, outlines step‑by‑step how to create one in PHP—including directory setup, class and interface definitions, dependency injection—and provides sample code for user management services and controller integration.
PHPService Layerbackend development
0 likes · 4 min read

The article explains why clear application layering—covering controller, service, manager, and DAO levels—is essential for maintainable backend code, reviews Alibaba's recommended layer structure, proposes an optimized layering model, and discusses domain model conversions to avoid excessive object transformations.
Domain ModelService Layerapplication layering
0 likes · 9 min read

Effective application layering, as outlined by Alibaba’s coding standards, separates concerns across controller, service, manager, DAO, and other layers, ensuring maintainable, reusable code; the article explains each layer’s role, domain model conversions, and practical tips for implementing a clean, team‑wide architecture.
Alibaba standardsBackendDAO
0 likes · 9 min read

This article presents a senior architect's comprehensive guide to evolving a classic three‑tier backend architecture into a flexible system composed of a gateway layer handling HTTP and TCP protocols, a business layer with services, processes and reusable components, and a foundation layer that defines interfaces and essential technical components such as storage, caching, messaging, transactions, and locking.
GatewayService Layertechnical components
0 likes · 13 min read

This article examines common misconceptions about application layering, outlines Alibaba's multi‑layer architecture—including Open Interface, Terminal Display, Web, Service, Manager, and DAO layers—offers optimized layering practices, explains domain model transformations, and provides actionable guidelines for building maintainable, reusable backend systems.
AlibabaBackendController
0 likes · 9 min read

The article explains why clear application layering—covering controller, service, manager, and DAO levels—is essential for maintainable backend code, describes Alibaba's recommended layer structure, proposes an optimized layering model, and outlines domain object conventions such as DO, DTO, BO, AO, VO, and Query.
BackendDAODomain Model
0 likes · 10 min read

The article compares MySQL's limited join capabilities with PostgreSQL's richer options, explains why multi‑table joins can be slower than separate single‑table queries performed in the service layer, and outlines how decomposing joins improves caching, scalability, and overall system performance.
Database ArchitectureMySQLService Layer
0 likes · 8 min read

This article examines MySQL’s limited join capabilities compared to PostgreSQL, explains why multi‑table queries over three tables can be inefficient, and explores strategies such as service‑layer joins, query decomposition, and caching to improve performance and scalability in database‑centric applications.
MySQLQuery DecompositionService Layer
0 likes · 9 min read

This article explains how to design a well‑structured Java web application by defining clear three‑layer architecture (Controller, Service, DAO), outlining each layer's responsibilities, describing data type conventions such as PO, BO, VO, DTO, Model, and showing how these types map to the layers for maintainable, scalable development.
DAOData Transfer ObjectsJava
0 likes · 13 min read

The article discusses common pitfalls in application layering, presents the Alibaba coding guideline for multi‑layer architecture, proposes an optimized layering model with clear responsibilities for controller, service, manager, and DAO layers, and explains domain model conversions to improve maintainability and reuse.
Alibaba guidelinesLayered ArchitectureService Layer
0 likes · 9 min read

This article explains common misconceptions about application layering, outlines essential principles for maintainable layers, details Alibaba's multi‑layer architecture, proposes optimized layering with service and manager responsibilities, discusses domain model conversions, and concludes with practical guidance for clear, reusable backend design.
Alibaba guidelinesDAOService Layer
0 likes · 8 min read

This article examines common misconceptions about application layering, outlines essential criteria for effective layering, details Alibaba's official multi‑layer architecture, proposes an optimized layering approach with clear responsibilities for controllers, services, managers, and DAOs, and explains domain model conversions across layers.
Alibaba standardsControllerDAO
0 likes · 9 min read

The article discusses the importance of proper application layering in backend development, critiques common misuse of controller and service layers, outlines Alibaba's recommended multi‑layer architecture—including open API, presentation, web, service, manager, and DAO layers—offers optimization suggestions, and highlights domain model conversions.
Alibaba guidelinesDAOService Layer
0 likes · 9 min read

This article explains the importance of clear responsibility separation in application layering, reviews Alibaba's recommended layer structure, proposes an optimized layering model, and discusses domain model conversions to improve code maintainability, reusability, and team collaboration.
Domain ModelLayered ArchitectureService Layer
0 likes · 9 min read

The article explains the importance of clear application layering, compares Alibaba's recommended multi‑layer architecture with practical optimizations, describes each layer’s responsibilities, discusses domain model transformations, and offers guidelines for maintaining clean, reusable, and maintainable backend code.
DAODomain ModelService Layer
0 likes · 10 min read

This article walks through the core functionalities and business flows of a single‑database order system—covering user order placement, order list queries, detail views, and cancellations—while explaining how Controller, Service, Repository, and Mapper components interact within the backend architecture.
ControllerService LayerWorkflow
0 likes · 6 min read

A well‑designed code structure reduces hand‑off friction, eases collaboration, and turns tangled, messy code into a clear, modular system by applying single‑responsibility, reusability, and explicit definitions across layers such as Model, Util, Service, Dao, and Controller.
DAOModelService Layer
0 likes · 9 min read

The article examines whether the Service layer in a Spring‑based Java project truly requires interfaces, debunks common justifications, proposes practical development workflows, and outlines project structures for both single and multiple implementations, concluding with recommendations on when to use interfaces.
JavaService LayerSpring
0 likes · 8 min read

This article examines whether Service and DAO layers in Java Spring applications must always have interfaces, explains why dependency‑injection frameworks make interfaces optional, discusses development workflows, multiple‑implementation scenarios, project structuring options, and outlines the trade‑offs of using or not using interfaces.
DAOJavaService Layer
0 likes · 9 min read

This article explains the classic three‑tier software architecture, detailing the responsibilities of the presentation, service, business, and data‑access layers, comparing MVC, MVP, and Presentation Model patterns, and discussing design considerations such as DTOs, WCF services, and common infrastructure for scalable enterprise systems.
Business LayerMVCService Layer
0 likes · 10 min read

The article discusses common pitfalls in application layering, presents Alibaba's clear multi‑layer architecture—including Open Interface, Terminal Display, Web, Service, Manager, and DAO layers—offers an optimized layering model with Thrift, explains domain model conversions, and provides practical recommendations for maintainable backend design.
DAOLayered ArchitectureService Layer
0 likes · 8 min read

This article walks through a simple e‑commerce order flow, highlights the drawbacks of tightly coupled service code, and demonstrates step‑by‑step refactorings—introducing repository abstractions, domain entities, an anti‑corruption layer, and a generic message producer—to achieve a clean, extensible, and testable backend architecture.
JavaService Layerclean architecture
0 likes · 9 min read

This article examines whether Service and DAO layers in Java backend projects require interfaces, arguing that with dependency‑injection frameworks like Spring the interfaces are often unnecessary, while outlining development workflows, project structures, and scenarios where interfaces remain useful.
JavaService LayerSpring
0 likes · 8 min read

This article explains the importance of clear application layering, compares common misconceptions with Alibaba's recommended multi‑layer architecture, discusses how to implement and optimize layers such as controller, service, manager, and DAO, and outlines domain model conversions to improve maintainability and reuse.
Alibaba standardsControllerDAO
0 likes · 8 min read

This article explains the importance of clear application layering, reviews Alibaba's recommended layer structure, proposes an optimized layering model, and discusses domain model transformations to improve code maintainability and reuse in backend development.
ControllerDAODomain Model
0 likes · 11 min read

The article explains that while a Service layer may seem unnecessary for simple business logic, it becomes essential as applications grow, offering benefits such as handling complex operations, supporting reuse across controllers, facilitating unit testing, and enabling flexible business logic composition.
Code MaintainabilityService Layerbackend architecture
0 likes · 3 min read

This article presents a complete Java-based parking system example, detailing functional requirements for users and administrators, and providing full source code for client interaction, entity definitions, service interfaces, and their implementations, illustrating backend development concepts such as singleton patterns, service layers, and basic CRUD operations.
Code ExampleJavaService Layer
0 likes · 17 min read

This article examines whether Service and DAO layers in Java Spring projects should always have interfaces, discusses the arguments for and against using interfaces, and proposes practical structuring and dependency‑injection techniques to decide when interfaces are truly necessary.
DAOJavaService Layer
0 likes · 8 min read

This article examines whether Service and DAO layers in Spring projects truly require interfaces, debunks common justifications, explores alternative project structures for single and multiple implementations, and offers practical guidelines on when to use or omit interfaces.
DAOService LayerSpring
0 likes · 8 min read

This article examines whether a Service layer in a Spring‑based backend project truly requires an interface, debunks common justifications, proposes practical development workflows, and outlines the advantages and drawbacks of using or omitting interfaces in various architectural scenarios.
Service LayerSpringbackend architecture
0 likes · 8 min read

This article examines whether a Service layer in a Spring‑based application truly requires an interface, analyzes common arguments for and against using interfaces, explores project structuring options, and offers practical recommendations based on real‑world development experience.
AOPService LayerSpring
0 likes · 7 min read

This article examines whether every Service and DAO class in a Spring‑based backend should implement an interface, evaluates the common arguments for using interfaces, explains why they often do not hold up, and proposes practical structuring and development approaches for projects that may or may not need multiple implementations.
DAOJavaService Layer
0 likes · 9 min read

This article explains how to build a high‑availability service layer for large‑scale web systems by vertically splitting business domains, adopting stateless design, configuring timeouts, using asynchronous messaging, ensuring idempotent operations, and applying service degradation techniques to maintain stability during traffic spikes.
BackendIdempotenceService Layer
0 likes · 11 min read

The article explains common misconceptions about application layering, presents Alibaba's multi‑layer architecture (open‑interface, terminal display, web, service, manager, DAO), proposes an optimized layering model with RPC, and discusses domain‑model conversions such as DO, DTO, BO, AO, VO and Query to achieve clear responsibilities and maintainable code.
Alibaba standardsDAODomain Model
0 likes · 8 min read

The article examines common misuse of base Controller and Service classes in Java micro‑service projects, explains why they violate design principles such as Liskov Substitution, and provides concrete refactoring steps—including moving injections, constants, and utility methods to appropriate layers—to achieve a clean three‑tier architecture.
JavaService LayerSpring MVC
0 likes · 24 min read

This article examines common misuse of base Controller and Service classes in Java Spring projects, explains why they violate the Liskov Substitution Principle, and provides practical steps to split, refactor, and properly structure code across the three‑tier architecture.
BackendJavaService Layer
0 likes · 22 min read

The article explains why clear application layering—controller, service, manager, DAO—is essential for maintainable backend code, reviews Alibaba's official layer definitions, proposes an optimized layering model with a Thrift TService layer, and discusses domain model conversions to balance reuse and simplicity.
Alibaba specificationControllerDAO
0 likes · 8 min read

This article explains the purpose of the Service layer in a Java SSM‑based high‑concurrency seckill project, walks through interface design, DTO/VO/PO concepts, provides full Service implementation with transaction management, custom exceptions, enumeration for status codes, Spring XML configuration, and unit testing examples.
JavaService LayerSpring
0 likes · 15 min read


21CTOSep 15, 2018 · Backend Development
The article summarizes a video on Laravel project structuring, explaining how separating responsibilities into layers such as Repository for data access, Service for business logic, Presenter for view preparation, Transformer for data shaping, and Formatter for consistent API responses improves maintainability and scalability.
LaravelPresenterRepository
0 likes · 6 min read

This article explains why placing business logic directly in controllers or models leads to redundancy in Laravel applications and introduces action classes as a modular, testable alternative, detailing their design principles, nesting, and decoration with practical code examples.
Action ClassesLaravelPHP
0 likes · 7 min read

This article explains why clear application layering matters, outlines Alibaba's recommended layer structure, proposes an optimized layering model with distinct responsibilities, and details domain model conventions to improve code reuse, maintainability, and team collaboration in backend development.
ControllerDAOService Layer
0 likes · 8 min read

The article explains why clear separation of responsibilities among controller, service, manager, and DAO layers is essential for maintainable backend code, outlines Alibaba's layered architecture guidelines, proposes an optimized layering model, and discusses domain model conversions across layers to avoid excessive object transformations.
DAODomain ModelLayered Architecture
0 likes · 9 min read

This article explains how to build a highly available service layer by vertically splitting business domains, adopting stateless architecture, configuring timeout policies, using asynchronous calls with message queues, ensuring idempotent operations, and applying service degradation techniques to handle traffic spikes and failures.
BackendIdempotencyService Layer
0 likes · 13 min read

This article examines Alibaba's Java framework layering approach, detailing each tier—from open API to DAO—while offering best practices for exception handling and domain model conventions to achieve clearer business logic and more maintainable code.
DAOException HandlingLayered Architecture
0 likes · 4 min read

Meituan built a scalable scenario‑query platform that unifies traffic, activity and investment data by layering RPC services, a Storm‑driven pre‑computation tree stored in Redis/Tair, and a middle‑platform API with circuit‑breaker logic, cutting response times from seconds to under one second while dramatically reducing code coupling and simplifying future feature development.
Apache StormNoSQLPrecomputation
0 likes · 12 min read

The article describes how Weibo evolved from a LAMP‑based first generation to a third‑generation, orthogonal‑decomposed backend architecture featuring three horizontal layers (interface, service, resource) and vertical technical components such as Web V4, MCQ queue, Motan RPC, object storage, SSD cache, and the WatchMan distributed tracing system for monitoring and service governance.
RPCService LayerWeibo
0 likes · 11 min read


21CTOMar 30, 2016 · Backend Development
This article details the design and implementation of a notification system, covering data models for notifications, user queues, subscription configurations, and a service layer with methods for creating, pulling, and managing announcements, reminders, and messages.
Service LayerSubscriptionbackend design
0 likes · 10 min read


21CTODec 4, 2015 · Backend Development
This article chronicles a developer's five‑year journey of designing a system by starting with the business layer, exploring entities, repositories, services, view models, MVC, and tooling, while highlighting common pitfalls and practical solutions for backend architecture.
BackendDDDRepository
0 likes · 15 min read


21CTONov 16, 2015 · Mobile Development
This article examines common architectural patterns for native mobile applications—including classic MVC, its MVVM extension, hierarchical HMVC, and various layered designs such as three‑, four‑, and five‑tier architectures—explaining their structures, advantages, and appropriate use cases to help developers choose the most efficient model.
HMVCMVCMVVM
0 likes · 7 min read

This article presents a practical IoT layered architecture model, contrasting the classic three‑tier view with a four‑tier structure (hardware, coordination, service, and application layers), explains the role of each layer, and advocates using hexagonal architecture for the service layer in the Lan platform.
IoTService Layerarchitecture
0 likes · 4 min read
