Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interface == Early binding?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Programmation orienté objet
Divers
Thread ID:
01040023
Message ID:
01040068
Vues:
12
Mike,

If I read what you are asking:
If you were doing this with a class, you would consider this to be late-bound, but with an interface you are not certain?

An interface is really just an abstract class with a pretty name :)

If I define an abstract class and an interface with the same function like this:
	public abstract class Class1
	{
		public Class1()
		{}
		public abstract void function1();
	}

	public interface interface1
	{
		void function1();
	}
The IL generated for these functions is the same:
.method public hidebysig newslot abstract virtual 
        instance void  function1() cil managed
{
} // end of method Class1::function1

.method public hidebysig newslot abstract virtual 
        instance void  function1() cil managed
{
} // end of method interface1::function1
The notion of classes and interfaces is really an abstraction for the programmer.

My understanding of late-bound/early-bound is if you don't know the type until runtime then it is late-bound.
- Craig

"If you're not prepared to be wrong, you will never come up with anything original."
- Sir Ken Robinson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform