본문 바로가기

Window Course/C

Binding(바인딩)

Binding : the association of objects (data and/or code) with identifiers
바인딩은 속성과 개체 또는 연산과 기호를 연관시키는 것이다.

1. Early Binding

 In programming languagesname binding or early binding is the association of objects (data and/or code) with identifiers.

 An identifier bound to an object is said to reference that object. Machine languages have no built-in notion of identifiers, but name-object bindings as a service and notation for the programmer is implemented by programming languages.

 Binding is intimately connected with scoping, as scope determines which names bind to which objects - at which locations in the program code (lexically) and in which one of the possible execution paths (temporally).

 Use of an identifier id in a context that establishes a binding for id is called a binding (or defining) occurrence. In all other occurrences (e.g., in expressions, assignments, and subprogram calls), an identifier stands for what it is bound to; such occurrences are called applied occurrences.

(by WIKIPEDIA)

정적바인딩(이른바인딩)은 실행시간 전에 바인딩해서 실행과정에서 변하지 않는 상태로 유지된다.

실행시간 전에 바인딩을 해야 하기 때문에 저장장소의 크기가 결정 되어야 한다.

속도는 빠르지만 그 코드는 그 코드, 그 함수만 실행이 가능하다..(실행과정에서 변할 수 X)


2. Late Binding
In object oriented programming, dynamic binding or late binding means determining the exact implementation of a request based on both the request (operation) name and the receiving object at run-time. It often happens when invoking a derived class's member function using a pointer to its base class. The implementation of the derived class will be invoked instead of that of the base class. It allows substituting a particular implementation using the same interface and enables polymorphism.
(by WIKIPEDIA)
동적바인딩(늦은바인딩)은 실행 하면서 저장장소가 결정된다.
저장아소의 크기를 지정하지 않아도 된다.
코드가 유연한 장점을 가지고 있다. 그러나 정적바인딩보다 속도가 느리다.
(함수의 포인터변수같은 것이 늦은바인딩이다.) 



'Window Course > C' 카테고리의 다른 글

함수포인터(Function Pointer)  (0) 2010.10.31