---
title: "Objects as Contracts for Behaviour"
url: https://daily.dev/posts/objects-as-contracts-for-behaviour-dhphkuytq
source_url: https://verraes.net/2014/09/objects-as-contracts-for-behaviour
type: article
source: "Mathias Verraes"
published: 2026-06-17T11:25:40.644Z
updated: 2026-06-17T11:27:28.148Z
tags: ["general-programming", "domain-driven-design"]
reading_time: 2
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Objects as Contracts for Behaviour

**[Mathias Verraes](https://daily.dev/sources/verraes)** · 2 min read · 0 upvotes · 0 comments

## Summary

A defense of proper object-oriented design, arguing that objects should encapsulate both state and behaviour rather than acting as mere data containers. Using the example of an invoice, the author explains that exposing behaviour like `invoice.pay(anAmount)` is the correct OOP approach because the ability to be paid is an inherent property of an invoice. The post pushes back against the common pattern of anemic domain models where services hold all business logic and objects are just bags of state.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://verraes.net/2014/09/objects-as-contracts-for-behaviour>

---

Tags: [#general-programming](https://daily.dev/tags/general-programming), [#domain-driven-design](https://daily.dev/tags/domain-driven-design)

[View this post on daily.dev](https://daily.dev/posts/objects-as-contracts-for-behaviour-dhphkuytq)
