Commands with dependencies

added by JefClaes
10/16/2012 4:13:31 AM

0 Kicks, 67 Views

Yesterday I wrote about an architecture which limits abstractions by solely introducing commands and queries. I shared a dead simple variation of this pattern, the advantages I experienced, and how I could still unit test the controller if I wanted to. At the end of that post I wondered how I would be able to test commands in isolation; suppose the implementation doesn't use a database this time, but a hairy, too low-level, third party webservice.


1 comments

bjames
10/16/2012 10:31:40 PM
I believe you are over complicating the issue. Why not just implement the ICommand interface which provides Execute(object parameter) that will allow you to pass pretty much any criteria that you want. Remember too much abstraction complicates design and maintenance.