Note of 《thinking in java》1

Introduction

  1. Thinking about designed, not simply coding.
(1). Introduction to object
  1. Thinking of an object as a service provider.
  2. In a good object-oriented designed design, each object does one thing well, but doesn't try to do too much.
  3. Java's default access: package access, public in the same package, but private to others outside the same one.
  4. First look into composition (rather than inheritance).
  5. You create a base type to represent the core of your ideas about some objects in your system.
  6. While designing derived methods, you should look closely for the possibility that your class might also need these additional methods.
  7. The more important way to differentiate your new class is to change the behavior of an existing base-class method. This is referred to as overriding that method.
  8. Substitution principle : pure substitution --- derived class has the exactly same interface to base class.
  9. Is-like-a relationship : if the derived class has to add some additional method.
  10. When dealing with type hierarchies, you often want to treat an object not as the specific type that it is, but instead as its base type. This allows you to write code that doesn't depend on specific types.
  11. Late binding : When you send a message to an object, the code being called isn't determined until run time.
  12. In java, dynamic binding is the default behavior, which is different from C++.
  13. Abstract keyword is a tool to enforce a particular design.
  14. With the support of single-rooted hierarchy, the garbage collector can thus send the appropriate message to every object in the system.
  15. A parameterized type is a class that the compiler can automatically customize to work with particular types.
  16. Exception handling existed before Object-Oriented language.
  17. A fundamental concept in computer programming is the idea of handling more than one task at a time.
  18. One of the most significant steps forward in client-side programming is the development of the plug-in.
  19. Plug-ins provide a "back door" that allows the creation of new client-side programming language.
  20. Plug-ins resulted in an explosion of scripting languages.
  21. A scripting language might solve 80 percent of the problems encountered in client-side programming.
  22. The most commonly discussed browser scripting languages are JavaScript --- Which has nothing to do with Java.
  23. When the applet is activated, it executes a program.
  24. Automatically downloading and running programs across the Internet can sound like a virus-builder's dream.
  25. A Web is the most general solution to the client/server problem.
  26. In java applications, you pay for the improvement through slower execution speed.
  27. In java, class designed to fit the problem tend to express it better.
  28. The fastest way to create a program is to use code that's already written: a library.
  29. Interpreted Java is slow, even 20 to 50 times slower than C in original Java interpreters.
  30. The key to making java feasible for many development projects is the appearance of speed improvement like so-call "just-in-time"(JIT) compilers.
  31. Native code compiler programs will eliminate the touted cross-platform execution of the compiled programs, but they will also bring the speed of the executable closer to that of C and C++.
  32. It's important to evaluate your own needs and decide whether Java will optimally satisfy those needs.
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章