other class in between. Now, when you call
other class in between. Now, when you call the draw method, the derived class moves up the inheritance tree until it finds an implementation of draw. Likewise, for each method called from within draw, the derived class starts at the currently class and moves up the tree to find each method. When it gets to the draw2ndLine method, it finds it immediately in the current class. So it isn t really called from the base class, but it does sort of seem that way. Summary and Consequences Template patterns occur all the time in OO software and are neither complex nor obscure in intent. They are normal part of OO programming and you shouldn t try to make them more abstract than they actually are. The first significant point is that your base class may only define some of the methods it will be using, leaving the rest to be implemented in the derived classes. The second major point is that there may be methods in the base class which call a sequence of methods, some implemented in the base class and some implemented in the derived class. This Template method defines a general algorithm, although the details may not be worked out completely in the base class. Template classes will frequently have some abstract methods that you must override in the derived classes, and may also have some classes with a simple place-holder implementation that you are free to override where this is appropriate. If these place-holder classes are called from another method in the base class, then we refer to these overridable methods are Hook methods.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services