Software Engineering Architecture Lab

Level 5: Enterprise Application Architecture

Structure a business application into layers, choose how domain logic and data access are organised, and understand what your framework does for you.

Outcome: Structure a business application into layers, choose how domain logic and data access are organised, and understand what your framework does for you.

The recurring structures inside every business app — from Fowler’s enterprise application patterns (layering, Service Layer, Repository, Unit of Work, DTOs, offline locks) to Hohpe & Woolf’s messaging patterns for connecting systems.

The pressure on ShopFlow: Business rules leak into controllers and SQL; nobody knows where logic belongs.

Lessons in level 5

  1. Layered Architecture: Presentation, Domain, Data — Why separating layers helps — and how layers become a lasagne of pass-through code.
  2. Transaction Script vs Domain Model vs Table Module — Three ways to organise business logic, chosen by how complex the logic is.
  3. Service Layer: One Front Door for Every Use Case — Define application boundaries, transactions and orchestration in one place.
  4. Active Record vs Data Mapper (and the Gateways) — Should objects save themselves, or should a mapper keep them ignorant of the database?
  5. Repository: A Collection-Like Home for Aggregates — Let the domain ask for objects without knowing about SQL.
  6. Unit of Work, Identity Map & Lazy Load — What JPA/Hibernate does for you — and how it surprises you (N+1, dirty checking).
  7. MVC, Front Controller & Friends — How Spring MVC’s DispatcherServlet embodies decades-old presentation patterns.
  8. Remote Facade & DTO: Designing Across the Network — Coarse-grained APIs and data transfer objects for expensive remote calls.
  9. Optimistic vs Pessimistic Offline Locks — Protect business transactions that span several requests.
  10. Enterprise Integration Patterns: Messaging Between Systems — Channels, routers, translators, dead letters and idempotent receivers.

Source books

Other levels