Posts Tagged: object oriented

More and more I am being intrigued by the power of a small code refactorings. The positive impact it has on the readability, the maintainability and understandability of your code is great. It keeps code clean(er) and since the changes you make are really small (I’ll demonstrate how small), the chance they will break things is small. Of course, with unit tests (you are writing them right?) making sure you did not break anything: a small refactoring is a low-risk high-benefit practice. In my experience, small refactorings are undervalued. In fact, I undervalued them much myself since… Read Article →

Today I had a little challenge. I had a Class, I call it Class A. It has a method, i call it “doSomething”. Class B extends Class A, and overrides this method with a totally new behavior. Class C who extends from Class B wants to have the original behavior from Class A. Here is a picture: Now, the simplest but most stupid way to solve this is using copy / paste. Yes, you simply copy the contents of the method of Class A and paste it into the method of Class C and you’re… Read Article →

Scroll To Top