Nice solution! :) But it has a hard dependency on grep and sometimes a concrate implementation derives from an abstract one so we would have to maintain class hierarchy.
– Peter KissJun 10 '13 at 06:00
Just abstract out a file system searcher which has grep as it's sole concrete implementation then inject it into your dependency figure outer. That should appease the IoC gods
– OrangepillJun 10 '13 at 06:02