티스토리 뷰



#


High-level code says to low-level code:


"Don't call us, we'll call you."


#


Frameworks are, in fact, a natural extension of THE TEMPLATE PATTERN.


BTW, The template pattern does not have anything to do with generic classes or templated containers.


In the template pattern, a complicated algorithm is implemented.

(Usually in the form of an instantiated method of an abstract base class.)


The abstract base class is a "template" for the complicated operation.


The abstract (unimplemented) methods left for the programmer are called "hooks".


# Basic point of the Template Pattern


1. Specify a complex set of steps, and have client code plug in specific implementations of individual steps.


2. Allow subclasses to customize parts of an algorithm, but force them to adhere to the overall algorithm.


# Use a framework


Frameworks are complicated collections of interconnected classes.


Using a framework gives way more power, but a lot less control than coding from scratch.


In using a framework, the real challenge is understanding how different classes and events in the framework interact with each other.


Listening on events is an important part of using frameworks correctly.


Framework makes EVENT, THE LISTENER waiting for and decide how to react to the EVENT is called.


When THE EVENT actually occurs, the Framework will call THE LISTENER code and pass it an object with the details of what just happened.


댓글
댓글쓰기 폼
공지사항
Total
394,932
Today
3
Yesterday
28
«   2018/11   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
글 보관함