
Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
> <r...@rediffmail.com> wrote in message
>
[quoted text clipped - 24 lines]
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net
> I think perhaps you're getting bogged down by nomenclature...
I guess you are right.....
I learnt the term "late binding" from a book which I am using to learn
ASP.NET. As stated in the book (& as stated in my previous post), late
binding means variables of type "Object" are not processed until
runtime but then variables of other data types are also not processed
until runtime i.e. until the app is run. Variables, let them be of any
data type, will be processed only when the app is being run (obviuosly
never at design time). So why does the book specifically mention that
*variables of "Object" data type are not processed until runtime*?
Also, if I am not wrong, it can be concluded from the statement given
in the book that variables of data types other than the "Object" data
type are bound early (early binding) Irrespective of whether
variables are bound early or late, the binding takes place during
runtime. So does late binding mean variables of "Object" data type are
processed only AFTER variables of all other data types have been
processed? If not, then what's the difference between late binding &
early binding?
Ron
Mark Rae [MVP] - 08 Oct 2007 09:22 GMT
> I learnt the term "late binding" from a book which I am using to learn
> ASP.NET. As stated in the book (& as stated in my previous post), late
[quoted text clipped - 4 lines]
> never at design time). So why does the book specifically mention that
> *variables of "Object" data type are not processed until runtime*?
See below...
> Also, if I am not wrong, it can be concluded from the statement given
> in the book that variables of data types other than the "Object" data
[quoted text clipped - 4 lines]
> processed? If not, then what's the difference between late binding &
> early binding?
Early binding and late binding were important before .NET, but are largely
irrelevant now...
Early binding means defining a variable of a specific type because you know
at design-time what type of variable you need...
DataSet MyDataSet = new DataSet();
Late binding means defining a variable of a non-specific type (usually an
Object variable) because all you know at design-time is that you will need a
variable of one sort or another, but can't know what *specific* type until
runtime...
object MyDataObject = null; // design-time
protected void Page_Load(object sender, EventArgs e) // runtime
{
if (SomeCondition)
{
MyDataObject = new DataSet();
}
else
{
MyDataObject = new SqlDataReader();
}
}

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net