News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mathias Verraes:
Value Objects and User Interfaces
November 18, 2013 @ 11:35:07

Mathias Verraes has a new post today with a response to an email he received about some comments on a recent Elephant in the Room podcast about Value Object usage. The question asks about usage of Value Objects, specifically when it comes to things like country information.

There's nothing intrinsically wrong with modeling countries as entities and storing them in the database. But in most cases, that overcomplicating things. Countries don't change often. When a country's name changes, it is in fact, for all practical purposes, a new country. If a country one day does not exist anymore, you can't simply change all addresses, because possibly the country was split into two countries. Whenever you have this kind of friction, there's usually some missing concept screaming to be discovered.

He talks some about the concepts around the "country" data and some of the functional concerns around it (duplicate checking, validation of existence, etc). He takes the concept and breaks it out into two different concepts - the actual Value Object of a single country and an "AvailableCountries" set (and "AvailableCountryRepository").

0 comments voice your opinion now!
value object country example registry set

Link: http://verraes.net/2013/11/value-objects-and-user-interfaces/

blog comments powered by Disqus

Similar Posts

Nexen.net: PHP Statistics for July 2006

Alexey Zakhlestin's Blog: PHP+SCGI part 2: problem with eZComponents

Dan Horrigan's Blog: The Value of Null

Kevin Schroeder's Blog: Passing typed ActionScript objects to Flex using PHP and a message queue

Brandon Savage's Blog: Q&A: Answering Some Questions About Object-Oriented Programming


Community Events





Don't see your event here?
Let us know!


deployment interview podcast release symfony community zendserver laravel voicesoftheelephpant api install language library unittest introduction framework package opinion bugfix series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework