Skip to main content

Posts

Showing posts with the label Architecture

Hexagonal Architecture (Ports & Adapters Pattern)

Hexagonal Architecture , also known as the Ports and Adapters pattern, is a software design pattern that aims to create a decoupled and maintainable application by separating the core business logic from external concerns (like databases, APIs, and UIs). Structure of Hexagonal Architecture A typical Hexagonal Architecture has three main layers: 1️⃣ Core Domain (Application Logic) This contains the business rules and domain models. It is completely independent of external technologies . Example: If you’re building a banking system , this part would include logic for transactions, withdrawals, and deposits . 2️⃣ Ports (Interfaces) These are interfaces that define how the core interacts with external components. Two types of ports: Inbound Ports (driven by external inputs like APIs, UI, or events) Outbound Ports (used to interact with external services like databases, messaging systems, etc.) 3️⃣ Adapters (Implementation of Ports) These are concrete implementations of the ports, re...

C4 Daigram

Understanding Complex Systems with C4 Diagrams A C4 diagram is a graphical representation of a software system's architecture, structured into four hierarchical levels: Context , Containers , Components , and Code . This model was developed by Simon Brown to provide a clear and concise way to communicate the architecture of complex systems. Levels of the C4 Model Context Diagram (Level 1) : Shows the system in scope and its interactions with users and other external systems. It provides an overview of how the system fits into its broader environment. Container Diagram (Level 2) : Decomposes the system into interrelated containers such as applications or data stores. It illustrates how these containers interact with each other. Component Diagram (Level 3) : Further decomposes containers into individual components. It details how these components interact within their container or with other containers/systems. Code Diagram (Level 4) : Offers detailed insights into ...