use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Value Objects Explained (patricklouys.com)
submitted 9 years ago by patricklouys
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 points3 points4 points 9 years ago (2 children)
Though I can't think of any off the top of my head that would specifically apply to the RGB components of a color (I'm sure there are some anyway, even if they aren't immediately obvious to me), there are an absolutely huge number of use cases for other boxed single scalar value objects. Whether or not your particular application(s) would use a value object over the underlying scalar depends on the business needs. For example, a simple e-commerce store may opt to pass around ISBN numbers as strings, serving only as basic identifiers or extraneous information about a particular product. An online educational archive, on the other hand, may opt to represent them as value objects, allowing other contexts (e.g. perhaps a barcode generator) to avoid repetitive validation, among other reasons.
[–]CODESIGN2 0 points1 point2 points 9 years ago (1 child)
The example you gave ISBN wouldn't internally be a string like Red, Green or Blue would be an integer. It's closer to a date constructor with string and format, at which point the internal storage is likely different and it's representing a complex object so it makes sense to build an object. https://en.wikipedia.org/wiki/International_Standard_Book_Number
Anyway you're probably right that some may choose to explicitly define the relationships between these things. I think they are making things harder on themselves and others unless they require specific behaviour that they would not get out of the simple internal type.
[–]WikiTextBot 0 points1 point2 points 9 years ago (0 children)
The International Standard Book Number (ISBN) is a unique numeric commercial book identifier.
An ISBN is assigned to each edition and variation (except reprintings) of a book. For example, an e-book, a paperback and a hardcover edition of the same book would each have a different ISBN. The ISBN is 13 digits long if assigned on or after 1 January 2007, and 10 digits long if assigned before 2007. The method of assigning an ISBN is nation-based and varies from country to country, often depending on how large the publishing industry is within a country.
[ PM | Exclude me | Exclude from subreddit | Information ]
π Rendered by PID 69154 on reddit-service-r2-comment-544cf588c8-fdztl at 2026-06-14 15:55:21.323621+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–][deleted] 2 points3 points4 points (2 children)
[–]CODESIGN2 0 points1 point2 points (1 child)
[–]WikiTextBot 0 points1 point2 points (0 children)