Thinking in Patterns Ch. 13: Reducing interface complexity

Thinking in Patterns with Java V0.9: Chapter 13: Reducing interface complexity: TIPatterns.htm#_Toc41169743

1, Sections:

 Facade. 105

   Package as a variation of Facade  106

2, The main content and feeling:

  What is Facade? Bruce tell me:"If something is ugly, hide it inside an object.".

  After reading this chapter, I can got some below:

 

  1), Design pattern is really a pratical technique.

  Although I read this book, and know some of Facade, and know its example://:

facade:Facade.java, but, I feel I can't understand it without a real applying

of this pattern. Maybe, I will use it later.

  2), Just like Bruce's feeling:"To me, the Facade has a rather "procedural" (non-object-oriented) feel to it: you are just calling some functions to give you objects."

  3), Facade is most useful to C++ programmer, in java, "package" is a

build-in Facade.

 

3, Questions about programming:

  

  1), If it is that the function of Facade Pattern is only acting as a factory to create some objects? It can't call another object's method to process something in a static method just like below?


class A {

  void f(){}

}

public class B {

  static void doFinA() {

    (new A()).f();

  }

}

  

Then, I can do something like this:

B.doFinA();

4, Questions about english language:

1), Strange words:

    cast about, mold, first-cut, tax adviser, tax code, mediator, as if, to be

fair, clash, majority

2), Difficult sentences:

 

                                     incomplete