“yes, you’re right, Microsoft uses GetTemplateChild in their controls. But the MSDN-Doc says for GetTemplateChild “Do not use. Use FindName instead.”
Snort this article, make a T-Shirt out of it and wear it at the office. http://en.wikipedia.org/wiki/GRASP_(Object_Oriented_Design)
The ultimate USB installation tool! From an .ISO to your system. Zero hassle. Pure goodness ;D
I heard it a lot of times. When I was learning Java, a flash definition about constructor methods faded away in the classroom. A “silly” definition that nobody seemed to remember a bunch of years later.
Sometimes the things that are easily forgotten are the most basic principles. We take them as a fact and we rarely reevaluate them.
One of the basics in OOP is the role of a constructor method:
A constructor method is a special method that contains ONLY the required initializations for the instance to be created in a valid state, ready to be used.
Said this, any constructor what invokes complex methods, services to retrieve data, contains lots of lines of code, or even loops, IS A MISTAKE and needs to be fixed.
A constructor has to be minimum! The instance should be created just in time and any complex initialization should be the responsibility of any other method of the instance.
This answer on Stack Overflow is very good. Be sure to read it 🙂 and keep you ctors clean!