Archive for June, 2009
Coding Tip #42: turning enums into classes
In Coding Tip #27 I explained how I rarely like to use booleans to represent states, and prefer to use an enum. Now that I have all nice little enums everywhere, another pattern that I see emerge is that I want more from my enum than just a value: perhaps other values associated with it, [...]
Posted: June 29th, 2009 under Design.
Comments: 5
Canned, Stubbed and Mocked Fake Objects
I had a very interesting discussion with Jen Smith today about the differences in approach to faking objects during testing. As a result, I am finally putting down my thoughts on the matter. Canned Objects Canned objects are fantastic to use in situations where you want an object to respond with a predefined value or [...]
Posted: June 25th, 2009 under Testing.
Comments: 6
I don’t believe in ORM object as your domain model
I have been on a few projects now where we have used ORM libraries to help store our data (eg ActiveRecord for Rails, Hibernate (and it’s variants), Castle’s ActiveRecord for .Net). On these projects, we have used the domain models and the ORM models are the same. The problem we faced with doing so is [...]
Posted: June 2nd, 2009 under Design.
Comments: 9