Jowen wrote:
Hmm. I don't like hitting the database. It is slow and I have to maintain two databases.
Aside from this discussion, it seems I don't really have a choice do I? (I'm currently using Self Servicing...)
It sounds pretty cumbersome to achieve this?! I'm not a big fan of modifying the template.
You're looking at a hierarchy of classes nested inside eachother: so customer.Orders returns IOrderEntity, but that IOrderEntity has an IEmployeeEntity instance reference which contains a list of IEmployeeEntities as well. Who's going to instantiate these instances if you're not going to the db?
Note: at the moment, I don't have time to experiment with Adapters, but I have a gut feeling this could be a better fit for me. I don't have to support other databases, but it might facilitate testability am I right?
You can mock the IDataAccessAdapter interface and thus not have to go to the db, but the same question stands: if you want real objects in a hierarchy/graph to work with, you need to build these somewhere.
And besides... your code might 'work' (as in: tests run) but that doesn't mean the code works on a database as filters might have been applied etc. etc. I.o.w.: if your goal is to test your code if it works, use a real db. You don't have to maintain two databases: we have templates which generate a DDL SQL script (see customer area -> v2.6 -> Tasks and templates) so you can apply that if something changes.