What main layers does traditional architecture include?
Traditional layered architecture usually consists of four main layers, each solving its own task and interacting only with the neighboring layer.
Presentation layer
This layer is responsible for everything the user sees and interacts with. It contains forms, web pages, mobile screens, and action handlers (for example, button clicks). Its main task is to accept input from the user and show them the result in an understandable form. Example: a web interface that sends a "create order" request and then displays a confirmation.
Application layer
This layer manages processes inside the system. It does not contain business rules, but coordinates how they run. For example, when a user places an order, the application layer defines the sequence of steps: create the order, verify payment, send a notification. It serves as the "connecting link" between the interface and the business logic.
Domain layer
This is the "heart" of the system: it describes the main business entities and the rules they follow. For example, in an online store these are the "Product", "Order", and "Customer" classes and logic such as "an order cannot be paid twice" or "the discount only applies above a certain amount". This layer does not depend on specific technologies or databases.
Infrastructure layer
This is where everything related to external resources lives: databases, network requests, file storage, external APIs. It implements the technical details that the other layers rely on. For example, a repository that stores an "Order" object in a database or sends an email through a mail service.
This way, each layer handles its own tasks and does not interfere with the others. This separation makes the system understandable, flexible, and easy to maintain: the interface or the database can be replaced without rewriting the whole application.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.