The question is about typehinting of the role interfaces. The code example has two DataMappers which typehint the interface they need in the constructor, FooDataMapper type hints the Preparable ...
Searching the web, we can find plentiful examples of various ORMs (nHibernate, EF, LinqToSql, etc.) that implement but don't actually support the full IQueryable<T> interface, throwing ...
I stumbled accross the SOLID principles. There is one burning question. Should I always use protocols? I never saw someone using them in the way that a Java developer would use them. I tried it in a ...
In C#/Java, the dependency inversion principle is often demonstrated by high-level classes that depends on an interface/abstraction (that it owns). Low-level classes will implement the interface, thus ...
In Appendix A to The Art of Unit Testing, Roy Osherove, speaking about ways to write testable code from the start, says, An abstract class shouldn't call concrete classes, and concerete classes ...
I have grown into using a principle for designing and consuming interfaces that says basically, "ask for only what you need." For instance, if I have a bunch of types that can be deleted, I'll make ...