Saturday, August 9, 2014

LSP Applies to Interfaces too

@albertoblaz: Yes, absolutely. LSP, summed up, really says "if Y subclasses/implements X, be sure that Y is really an X". In your case, Y is a Wall. If it implements IMovable, it breaks LSP because it's not movable. You get into more complex debates like whether a Square is a Rectangle (technically yes, programmatically no), but you're still in easily-defined territory here. – pdr May 24 '13 at 9:14
http://programmers.stackexchange.com/questions/199218/is-it-good-to-have-an-interface-plenty-of-methods-which-belong-to-different-conc?rq=1