Well you extension vs modification has sometimes the same results and sometimes it is different.
Just as a simple example to prove why you have to extend over modification is the situation where there are many apps using this class. If they are expecting a certain implementation, and in your new app that will use this class needs a different implementation, then modifying the class will break the older applications.
Example
I have a Commission class. App1 expects Commission to calculate as (Gross Profit-Costs)/10%, and this happens to be hard coded in the class. (Forget about some OOP ways around this bad design), Now App2 needs to calculate the commission as Gross Profit/5$.
In the Commission class the method calculated has this code. If you modify the class to have the new calculation then App1 will get the wrong results. However, if you extend the class and override the calculate method in the extended class with the new calculation then App1 can still use the Commission class, and App2 can use the NewCommision class without breaking each other.
Hope that helps in some part. There are other reasons in deciding when to do modify vs extend, but I have to get back to work.
Mark