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: Value Objects Explained with Ruby - SitePoint. 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.
Thanks so much @christoomey. It is working now.