handle handle


If you ask me Win32 program to design a concept of what impressed me most (most pit father) is, then I will not hesitate to tell you - the handle (Handles). The reason, either MSDN or Wikipedia for explanations "handle" the word seemed too professional, is a totally aggressive, not to scare the urine beginners will not give up the posture.

And this concept is precisely the entry Win32 programming you want to go beyond the first high mountain: file handle (HANDLE), handle handle (HWND) window handle to the bitmap (HBITMAP), device context handle (HDC), the menu (HMENU), examples of the handle (HINSTANCE) ...... turns out to go hand in hand, everywhere.

Design Philosophy

I must admit, with the "philosophy" to the word as the title is a bit big. In fact, with the vernacular, it is why design "handle" this thing, and the design of this thing in the end what good.

So let us put thoughts back to the ancient days, first.

Suppose you lead a team of pioneers, your goal is to build your village on a plain inland. The present situation is, this place though rich products, but not similar to the surrounding rivers and lakes so directly usable fresh water resources, then how would you do?

- the course is playing well.

good idea! But then the question again:

This is a 10 meter deep well, how would you solve the problem of drinking water? After all, down to the bottom of the well to drink water directly not only time consuming, but there is a certain risk.

This problem does slightly brain-dead, because our ancestors had invented a marvelous aid to solve this problem. This tool is, as we know pulley, as shown below.

From this FIG Sung inventor book "Heavenly Creations" a book, which illustrates the structure and use of the winch. Okay, now let's do some interesting analysis from a programmer's perspective, that is just mentioned the so-called "design philosophy" - of course, it is on the windlass.

  • Throughout the process of fetching water, fetching water we do not need to care about those who implement the entire well, nor need to focus on the internal mechanism winch operations. After this "black box" form, the only thing he do is turn the handle, and nothing more.
  • Because the aid of a winch, water does not have to directly face the bottom of the well - that is unfathomable well water, thereby greatly reducing the risk factor to draw water.

definition

I believe, so that it should be able to make you understand the significance of the handle on the winch. In view of the English handle and the handle is the same word "handle", then I think the definition of "handle" the word can also give out:

The so-called handle, refers to finally get back in some cases we consider for ease of use and security, in order to hide the real data objects and bind them in some way or the mapping and the use of descriptors.

Guess you like

Origin www.cnblogs.com/xfcode/p/11986946.html