Hi everyone,
I just discovered this mailing list a few weeks ago although I have purchased several of the Clean Code screencasts.
Lots of good discussion here.
My question is: When you are test-driving your implementation of a database backed Entity Gateway, specifically a read/select method which finds an entity from the database, how would you seed the database?
Would you create an entity, persist it, then retrieve it back using the gateway?
OR:
What if your framework (Rails, in this case) provides an easy way to create entries in the database via framework classes that you subclass (i.e. ActiveRecord)? Would you use this shortcut?
After writing this question, I feel that most people would lean towards the former. It demonstrates how a client -- an interactor -- might use the gateway interface. I see one problem with this; it's that I would have to implement saving before implementing a read/select/find operation.
Thoughts?