c# support late binding or early binding.

Answer Posted / pooja gupta

Binding refers the object type definition. You are using
Early Binding if the object type is specified when
declaring your object. Eg if you say Dim myObject as
ADODB.Recordset that is early binding (VB example).
If on the other hand you declare your object as a generic
type you are late binding. Eg if you Dim myObject as Object
(VB example).
One should note that binding is determined at object
declaration and not at object instantiation. Therefore it
does not matter if you later go on to Set myObject = New
ADODB.Recordset or Set myObject = CreateObject
(”ADODB.Recordset”).
Early binding allows developers to interact with the
object’s properties and methods during coding. You can
enjoy the benefits of intellisense. Also, early binding
permits the compiler to check your code. Errors are caught
at compile time. Early binding also results in faster code.
It’s disadvantage is that you cannot create a generic
object which may be bound to different types of objects.

Late binding on the other hand permits defining generic
objects which may be bound to different objects. Eg you
could declare myControl as Control without knowing which
control you will encounter. You could then query the
Controls collection and determine which control you are
working on using the TypeOf method and branch to the
section of your code that provides for that type. This is
the only benefit of late binding. It’s disadvantages are
that it is error prone and you will not enjoy much
intellisense whilst coding.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

1859


a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.

1383


What are stl algorithms?

627


how to use C++?

2067


how can u do connectivity in c++ language? plz send me connectivity code in c++ ?

1897






What does stl mean in slang?

652


How does an stl file work?

656


What does stl stand for in basketball?

647


Can we use stl in coding interviews?

1282


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

2097


Is stl open source?

638


What are the various types of stl containers?

736


write a program that will accept a number and print.its equivalent in words the maximum input number is 9999

2504


what is template and type convertion

1999


When did c++ add stl?

740