What are Value Objects in Domain-Driven Design? Value Objects...

@mjovanovictech
Milan Jovanović@mjovanovictech
18 views Dec 22, 2023 ~1 min read
Advertisement
1
What are Value Objects in Domain-Driven Design?

Value Objects represent a descriptive aspect of your domain. Unlike entities, they don't have a concept of identity.

There are two main qualities of Value Objects:

- They are immutable
- They have no identity

Another quality of value objects is structural equality. Two value objects are equal if their values are the same. But this won't help you understand what value objects are.

So here's an example. 👇

Money and date range can be value objects.
Money consists of an amount and currency
A date range consists of start and end dates.

This still leaves many questions:

- How do you implement value objects
- When should you use value objects?
- How do you persist value objects?

This is precisely what 35,879+ engineers will find out in tomorrow's newsletter.

Do you want to join us?

Subscribe here: milanjovanovic.tech/?utm_source=Tw…

P.S. I'll share the complete ValueObject base class implementation I use in my projects.
Media image
2
I write about software engineering & architecture every Saturday.

More than 35K+ engineers read it for practical tips and guidance to accelerate their .NET skills.

Join us here: milanjovanovic.tech/?utm_source=Tw…
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement