KyoMel / Yogyakarta, Indonesia

Term 216216 / 344

The Naked Objects Pattern

Month
April 2026
Day
20
Source
2026/apr-term.md

Definition:

The Naked Objects Pattern is a software architectural pattern where the user interface is automatically generated directly from the domain model — with no manually written presentation layer, no view controllers, no UI mapping code, and no translation between business objects and screens — instead, domain objects are “exposed naked” to the user, and the system automatically renders them as interactive UI components, deriving every screen, form, action, and navigation path purely from the structure, properties, and behaviors defined on the domain objects themselves.

Naked Objects eliminates the traditional “UI layer” entirely — instead of developers building screens that represent domain objects, the domain objects themselves become the UI, and users interact with the actual business model directly, without a hand-crafted presentation layer standing between them and the domain.

Background — Why Naked Objects Exists Traditional layered architectures force developers to write the same information three times:

The Traditional Three-Layer Redundancy Problem:

You have a domain object: Customer → name: string → email: string → address: Address → placeOrder(): Order → suspend(): void → getOrderHistory(): List

Layer 1 — Domain Model: define it once ✅ class Customer { name: string email: string placeOrder(): Order suspend(): void }

Layer 2 — Application/Controller: define it AGAIN ❌ class CustomerController { getCustomerForm() → map Customer → CustomerDTO postCustomerForm() → map CustomerDTO → Customer placeOrderAction() → call customer.placeOrder() suspendAction() → call customer.suspend() getOrderHistory() → call customer.getOrderHistory() → map Orders → OrderDTOs }

Layer 3 — UI/View: define it A THIRD TIME ❌

<input name=“name” …/> <input name=“email” …/> … order history rows …

Every change to Customer requires 3 coordinated changes: Add a field → update domain + controller + view Add a method → update domain + controller + view Rename property → update domain + controller + view

Three-layer tax paid: FOREVER, for EVERY change ❌

Naked Objects solution: Define it ONCE in the domain model ✅ UI is AUTO-GENERATED from the domain model ✅ Controllers don’t exist ✅ Views don’t need to be written ✅ Change domain → UI updates automatically ✅

Example:

Insurance Claims Management System An insurance company builds a claims management system using Naked Objects. Watch how every feature is driven purely from the domain model with zero UI code written.

Building the Claims Management System:

Feature: "Add approve/reject workflow to claims"

TRADITIONAL APPROACH:
  Domain layer:         2 hours  (add approve/reject methods)
  Service layer:        3 hours  (ApproveClaim/RejectClaim commands)
  Controller layer:     3 hours  (ApproveController, RejectController)
  ViewModel/DTO:        2 hours  (ClaimApprovalViewModel)
  View/template:        4 hours  (approve.html, reject.html, modals)
  Routing:              1 hour   (URL routes, method mappings)
  Validation wiring:    2 hours  (client + server validation)
  Testing each layer:   4 hours
  ─────────────────────────────
  Total:               21 hours  ❌

  Change: "Add a 'Dispute' status and disputeClaim() action"
    Domain layer:    30 min
    Service layer:   1 hour
    Controller:      1 hour
    ViewModel:       45 min
    View:            2 hours
    Route:           15 min
    Tests:           1 hour
    Total:           6.5 hours per new action ❌

NAKED OBJECTS APPROACH:
  Domain layer:        2 hours   (add approve/reject methods
                                  with annotations)
  Framework generates: UI, validation, routing, forms — all ✅
  Testing domain:      1 hour
  ─────────────────────────────
  Total:               3 hours   ✅

  Change: "Add a 'Dispute' status and disputeClaim() action"
    Domain layer:    30 min      (add method + annotations)
    Framework:       generates everything else
    Total:           30 min per new action ✅

Full project comparison (8-month project):

                    Traditional     Naked Objects    Savings
                    ───────────     ─────────────    ───────
Lines of code:      47,000          12,000           ↓ 74% ✅
  (domain only)     (8,000)         (12,000)
  (UI + mapping)    (39,000)        (0)

Time to delivery:   11 months       5 months         ↓ 55% ✅
Bugs found (UI      312             41               ↓ 87% ✅
 layer bugs):
New feature (avg):  2.5 weeks       3 days           ↓ 76% ✅
Onboarding new      4 weeks         1.5 weeks        ↓ 63% ✅
 developer:
Codebase to learn:  4 layers        1 layer          ↓ 75% ✅

Keep reading