Evolution of Layered Architecture: From Monolithic to Core Layer
This article outlines the progressive evolution of a company's software layering strategy—from an initial monolithic approach through webapp, business, base, and core layers—explaining the motivations, definitions, and practical implementations of each stage.
The evolution of layered architecture is driven by real business needs, and this article discusses the company's progressive layering approach.
Stage 1: "Mixed Soup"
Initially, all components—including backend management, frontend business, and user login—were bundled into a single project, leading to tightly coupled code.
Stage 2: Webapp Layer
To prevent a single login failure from affecting all services, the frontend, backend management, and login functions were separated into distinct applications, forming a distributed architecture where each could operate independently.
The webapp layer provides external services to internet users, with each project containing its own non‑shared business logic.
Stage 3: Business Layer
When multiple web applications share common business processes (e.g., order handling across a course platform and a TV video platform), those shared processes are extracted into a separate project (often a JAR) that other webapps can reference.
The business layer is defined as a set of projects that provide shared business workflows.
Stage 4: Base Layer
When several business projects need to share the same underlying resources (e.g., user services required by both order and single‑sign‑on business projects), a dedicated project is created to encapsulate those resources, allowing multiple business projects to reuse the same code.
The base layer projects represent a single real-world core entity (such as User, Course, or Exam) and contain all objects related to that entity.
Stage 5: Core Layer
Across all higher layers, there are common services unrelated to specific business logic, such as database persistence, Redis caching, HTTP wrappers, and utility libraries. These are extracted into independent projects forming the core layer, which provides foundational capabilities without business ties.
Stage 6: Usage
When building a new product, the team analyzes whether the product requires independent services (create a webapp project), provides reusable business processes (create a business project), contains standalone core entities (create a base project), or needs generic capabilities (create a core project). Dependencies flow downward: higher layers may use lower‑layer projects, while webapp projects cannot directly reference each other.
Note
Core layer projects can be used by any other layer; projects within the same layer may reference each other; webapp projects must rely on business or base layers for shared services; upper layers may depend on lower layers.
Java Captain
Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.