Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
End-to-End Modeling: Taking the Leave Module from Requirements to Working Code
Diagrams pay off when they form a traceable chain from requirement to endpoint, from state machine to domain code and from ER to migration, and when they answer "which diagram changes?" before a change is made. In the series finale we take the leave module to .NET 10 API, EF Core and Angular 22 code, measure the impact of a half-day leave requirement with git diff and show the real bugs the diagrams caught along the way.
Mermaid and Structurizr DSL: Diagrams Inside Markdown, Model-Based C4 and Which One to Choose
Mermaid is the right tool for quick diagrams that render directly in GitHub and Azure DevOps Markdown, the Structurizr DSL for deriving consistent C4 views from a single model. This post converts the series' diagrams to Mermaid and shows its syntax traps with real output, draws the same container diagram with Structurizr and compares PlantUML, Mermaid and Structurizr.
Diagrams as Code with PlantUML: Syntax, C4-PlantUML, Includes and Rendering in CI
PlantUML describes a diagram in a text file and renders it locally or in CI, so the diagram changes in the same PR as the code, gets diffed and is validated with --check-syntax. This post walks through the PlantUML sources of the series' use case, class, sequence, state and C4 diagrams, sharing a style with !include, rendering in GitHub Actions, and the privacy risks of the public server and the source embedded in SVGs, with real output.
ER Diagrams: Chen and Crow's Foot Notation, Cardinality, Optionality and from Class Diagram to Tables
An ER diagram shows which tables hold the data and the minimum and maximum number of records at both ends of every relationship: Chen suits concept conversations, Crow's Foot suits table and FK conversations. In this post we draw the leave module in both notations, show how composition, association classes and inheritance become tables with real EF Core output, and generate a Mermaid erDiagram straight from the EF Core model.
The C4 Model: Context, Container, Component, Code and Notation Rules
The C4 model describes a software system as zooming maps at the Context, Container, Component and Code levels, each for a different reader; the first two levels are enough for most teams, and a C4 container is not a Docker container but a running application or data store. In this post we draw the HR Portal's Context, Container and Component diagrams following the notation checklist, write them as C4-PlantUML and show how to use C4 together with UML.
Deployment Diagrams: Nodes, Artifacts, Execution Environments and a Docker/Azure Topology
A deployment diagram shows which nodes and execution environments the software runs on, which artifact is placed where, and over which protocol and port the nodes talk. In this post we draw the HR Portal's docker compose development environment and its Azure production topology, and build the «manifest» bridge between artifacts and components.
Component Diagrams: Provided/Required Interfaces, Ports and Drawing .NET Modules
A component diagram splits a system into replaceable modules and shows which interfaces each module provides (lollipop) and which it requires (socket); in .NET that means a public contracts project, an internal implementation and DI registrations in the composition root. In this post we draw the Leave, Payroll and Notification modules with ports and delegation connectors and read the wiring back from the DI registrations.
State Machine Diagrams: States, Transitions, Guards, Entry/Exit and Turning the Leave Request Lifecycle into Code
A state machine diagram shows which states an object can be in and which event, under which guard, moves it where; every arrow becomes a switch arm, a Stateless PermitIf and a unit test. In this post we draw the leave request lifecycle with a composite state, a choice and the entry/effect distinction, and turn it into C# and tests.
Activity Diagrams: Actions, Decisions, Fork/Join, Swimlanes and Modeling an Approval Workflow
An activity diagram draws a workflow as steps, guarded decisions, parallelism with fork/join and swimlanes showing who does what; its semantics is token flow, so paths leaving a decision that do not meet in a merge get stuck in an implicit join. The post draws the HR Portal leave approval process with swimlanes, demonstrates the token rules with a small C# simulator and splits the flow into handlers.
Sequence Diagrams 2: alt, opt, loop, par, break and ref for Error Paths and Async Flows
Combined fragments add conditions (alt, opt), early exit (break), repetition (loop), parallelism (par) and indivisibility (critical) to a sequence diagram, while ref calls another diagram; an asynchronous message has an open arrowhead and stays asynchronous even when awaited if the sender does not wait for the result. The post draws the HR Portal approval flow, the insufficient balance error and the e-mail and calendar entry sent through a queue from the real code.
Sequence Diagrams 1: Lifelines, Message Types, Activation and the Journey of an API Request
A sequence diagram shows the messages between participants in one scenario in time order: lifelines side by side, time flowing down, synchronous calls with filled arrowheads and replies with dashed lines. The post draws the HR Portal's POST /leave-requests request from Angular to SQL Server from the real code and EF Core log, and gives it as Mermaid code too.
Object and Package Diagrams: Runtime Snapshots and the Dependency Map of a .NET Solution
An object diagram draws concrete instances and links at a given moment and catches multiplicity mistakes in a class diagram, while a package diagram shows dependencies between projects and makes layer violations visible. In this post the snapshot of request #42 exposes a wrong 0..1, and the solution's package diagram is generated from the csproj files so an EF Core dependency leaking into Domain is caught in CI.