Week 13, year 2011
- Representing Money in PHP, Fowler-style - Whenever working with values in object oriented programming, it’s often a good idea to wrap them in a ValueObject. Money is a perfect candidate for a ValueObject: When talking about money, numbers are meaningless if they are not combined with a currency. I’ve been using a very simple version of the Money pattern as described in Martin Fowler’s PoEAA. I couldn’t find a PHP implementation anywhere, so I decided to make my own little open source library for it. You can find it on my GitHub account (where else?). Immutability An important aspect of ValueObjects is their immutability: Let’s say Jim and Hannah both want to buy a copy of book priced at EUR 25. [Mathias Verraes]
- Random thoughts on using Git - A couple of weeks ago, I switched from Subversion to Git for a couple of smaller projects. Below are some of my findings. Switching from Subversion Git is a little harder to understand than Subversion, because of it’s lack of a centralized repository, and because it has more concepts you need to understand. But if you already understand SVN well, it’s very manageable. I’ve no idea how the learning curve compares to SVN for a complete newbie to version control. If you are on the fence, there are two things that I wish I knew about sooner: Git Immersion only takes an hour or so, but you’ll understand so much more of git than when using conventional books or tutorials. [Mathias Verraes]