3 ms·
Or use an interface, then anyone making changes further down the line could leave the 'Save()' calling code alone entirely.
by danparsonson 16y ago
Or use an interface, then anyone making changes further down the line could leave the 'Save()' calling code alone entirely.
- noblethrasher 16y agoThat would work too but an abstract class let's you keep the _save method private so that client code can't possibly call that instance method on null. Personally I think that now that we have extension methods, all public methods should be extension methods on interfaces or abstract classes. This basically gives you something like the pattern matching in ML and Haskell.