Files
java-design-patterns/value-object/index.md
T
JuhoKang 083065ba93 Added index.md
Added index.md with explanation which seems a little bit short of detail.
Fixed the directory of the files.
2016-01-28 23:33:46 +09:00

35 lines
1.1 KiB
Markdown

---
layout: pattern
title: Value Object
folder: value-object
permalink: /patterns/value-object/
categories: Creational
tags:
- Java
- Difficulty-Beginner
---
## Intent
Provide objects which follow value semantics rather than reference semantics.
This means value objects' equality are not based on identity. Two value objects are
equal when they have the same value, not necessarily being the same object.
![alt text](./etc/value-object.png "Value Object")
## Applicability
Use the Value Object when
* you need to measure the objects' equality based on the objects' value
## Real world examples
* [java.util.Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html)
* [joda-time, money, beans](http://www.joda.org/)
* [JSR-310 / ThreeTen project LocalDate](http://www.threeten.org/articles/local-date.html)
## Credits
* [Patterns of Enterprise Application Architecture](http://www.martinfowler.com/books/eaa.html)
* [VALJOs - Value Java Objects : Stephen Colebourne's blog](http://blog.joda.org/2014/03/valjos-value-java-objects.html)
* [Value Object : Wikipedia](https://en.wikipedia.org/wiki/Value_object)