Ga naar de hoofdinhoud

Sort domain model building blocks

Classify common OOP domain objects by DDD tactical responsibility.

object-oriented-programming5 min read

Sort each candidate by the responsibility it should carry in an object-oriented domain model. Entity: identity and lifecycle Value Object: value equality and invariants Domain Service: domain operation across objects Repository: persistence collection boundary Payment with payment ID, status transitions, and capture history Money with amount, currency, arithmetic, and value equality PaymentRepository.findById(paymentId) and save(payment) FraudScreeningService.score(order, customer, paymentMethod) EmailAddress that normalizes casing and validates domain format Subscription with stable ID, pause/resume/cancel lifecycle ExchangeRateService.convert(money, targetCurrency, date) OrderRepository.nextPendingShipmentBatch(limit)

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Neem contact op