20 April 2014

The Ruby Reflector

Topic

Value Objects

  Source Favicon
Email

Today's release of Ruby Science includes three new chapters. If you're already reading Ruby Science, make sure to grab the latest version .

This week's updates include tips on safely extracting classes, as well as a specific example of extracting Value Objects. In addition, we discuss how you can use Ruby's classes-as-objects attitude to eliminate the need for most abstract factory classes.

The book is a work in progress, and currently contains around …

robots.thoughtbot.com Read
  Source Favicon
By Iain Hecker of Adventures with Ruby over 3 years ago.
Email

Value Objects

Objects that don't have any real identity are called "Value objects". Any object that is a value object has no real identity, nor is it important to know its identity.

Addresses are a good example. The value of the address (e.g. street, house number, city, country) is important. But it's less obvious to store this in a database and reference it by an id. This id would be purely superficial and have no meaning in the domain you are designing.

A pure Ruby

iain.nl Read
  Source Favicon
By iain hecker of Adventures with Ruby over 3 years ago.
Email

Value Objects

Objects that don't have any real identity are called "Value objects". Any object that is a value object has no real identity, nor is it important to know its identity.

Addresses are a good example. The value of the address (e.g. street, house number, city, country) is important. But it's less obvious to store this in a database and reference it by an id. This id would be purely superficial and have no meaning in the domain you are designing.

A pure Ruby

iain.nl Read