This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/value-objects
hey guys, love the videos but unfortunately I don’t think this one did a great job of explaining value objects. The colour (I’m british ;)) example was pretty confusing, especially without seeing any code examples. The really good bit of value objects (how two instances are equal) doesn’t get talked about until ~7mins or something. This could have been explained with some decent examples such as:
Color.new_from_rgb(255, 0, 0) == Color.new_from_hex('#ff0000') # explicit static methods to show instances are created
Describing how integers could be value objects was quite confusing too (you’re right, they could be) but there are plenty of better things that could have been used as an example to describe a value object: email address, currency, temperature, weight, etc.
keep up the good work! I look forward to fridays to see the latest video from you both
An applied example would’ve been nice. I’m left kinda clueless as to how I’m going to implement what was said here!
After watching this episode, still have no clue about how to implement value object. I’d could use some code examples as well. I found some examples on this link: http://www.sitepoint.com/value-objects-explained-with-ruby/. Maybe helpful to other people too.
@wiserfirst thanks for sharing this link that’s what I was looking for. I would also recommend the Value Objects chapter in The Rails 5 Way.
This video needs some kind of code examples to be of any practical help!
When I try to access the exercise’s link, it redirects me to https://whetstone.thoughtbot.com/exercises/10 and I get an ERR_NAME_NOT_RESOLVED
Hi @duduribeiro, sorry for the trouble there. It should be linking to https://exercises.upcase.com/exercises/extract-value-object. I’ve updated the show notes as well to prevent further confusion.