In _accountType == "SavingsAccount" you're comparing an int with a string. Just saying. ;)
Great article, one thing though: ExType is not defined in the multiple logger types example
This article is really SOLID :D
for the last part Customer constructor should be Account right?
Using obj as a variable name for the Loggers is bad.
FIX : rename it to logger
Some people (myself included) say that logging also pollutes your class and violates srp. That's why I switched to AOP logging.
Nice explanation of SOLID principles with good examples.
If you're really trying to learn about OOP, read Sandi Metz's Practical Object-Oriented Design in Ruby and 99 Bottles of OOP. They'll teach you solid OOP.
This is one of the best articles I've read, that explain the practical need for OOP with an example !
Cool solid examples :)
That was a pretty solid read! (no pun intended) Your examples were great. :)
Good one for every level..
Really enjoyed reading this as I'm looking into patterns and code structure. The usage of real world examples and requests from the business are excellent.
This article is a fine introduction to the ideas of maintainable OOD and OOP.
Good Idea (Y)
Very good, thanks
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.