프로그래밍
-
Abstract Factory프로그래밍/디자인패턴 2012. 12. 8. 21:04
Motivation Modularization is a big issue in today's programming. Programmers all over the world are trying to avoid the idea of adding code to existing classes in order to make them support encapsulating more general information. Take the case of a information manager which manages phone number. Phone numbers have a particular rule on which they get generated depending on areas and countries. If..
-
Factory Pattern프로그래밍/디자인패턴 2012. 12. 8. 20:58
Motivation The Factory Design Pattern is probably the most used design pattern in modern programming languages like Java and C#. It comes in different variants and implementations. If you are searching for it, most likely, you'll find references about the GoF patterns: Factory Method and Abstract Factory. In this article we'll describe a flavor of factory pattern commonly used nowdays. You can a..
-
Decorator Pattern프로그래밍/디자인패턴 2012. 12. 8. 20:53
Motivation Extending an objects functionality can be done statically (at compile time) by using inheritance however it might be necessary to extend an objects functionality dynamically (at runtime) as an object is used. Consider the typical example of a graphical window. To extend the functionality of the graphical window for example by adding a frame to the window, would require extending the w..
-
Observer Pattern프로그래밍/디자인패턴 2012. 11. 20. 16:07
Motivation We can not talk about Object Oriented Programming without considering the state of the objects. After all object oriented programming is about objects and their interaction. The cases when certain objects need to be informed about the changes occured in other objects are frequent. To have a good design means to decouple as much as possible and to reduce the dependencies. The Observer ..
-
Strategy프로그래밍/디자인패턴 2012. 11. 19. 10:38
Strategy Motivation There are common situations when classes differ only in their behavior. For this cases is a good idea to isolate the algorithms in separate classes in order to have the ability to select different algorithms at runtime. Intent Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that us..
-
-
C# 키보드 후킹 (샘플)프로그래밍/프로그래밍 관련 2012. 6. 3. 18:49
Just hook! 첨부된 파일을 먼저 확인하시라. 컴파일을 수행하고 Hook! 버튼을 누르면 해당 폼에서뿐만 아니라 전체 윈도우에서 delete, tab, esc 키 등이 입력되지 않는 것을 확인할 수 있다. (alt + tab 등도 tab키가 입력되는 조합이므로 입력되지 않는다) 실제 코드를 살펴보자. (Form1.cs 참조) KeyboardHooker의 사용 방법은 실로 간단한데, 단순히 KeyboardHooker.HookedKeyboardUserEventHandler 딜리게이트를 처리할 수 있는 이벤트를 만들고, 이벤트 핸들러를 KeyboardHooker.HookedKeyboardUserEventHandler에 등록하면 된다. private void Form1_Load(object sender, ..
-
Dumpbin - Checking Your Application Compiled Platform (x86 vs x64)프로그래밍/프로그래밍 관련 2012. 5. 6. 13:41
dumpbin is a program in Visual Studio Tools that helps you to display information in binary file. I find it useful to check whether a dll is build for x86 or x64. Corflags is good for checking .exe, and soon, you will realize that it is not effective on checking dll files. Especially for unmanaged dll, you will see this error message corflags : error CF008 : The specified file does not have a va..