Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Early vs Late bind. What do you think?

Status
Not open for further replies.

oneshadow

IS-IT--Management
Dec 23, 2004
125
ID
Hi all
I found an article in MSDN (it may be a little late now since that article was released on March 30, 1999) about Bind vs Unbind to ADO reference.

On an early bound, usually people go to Project References and select the ADO library, and on code, they type :


Dim adoConn1 As ADODB.Connection
Set adoConn1 = New ADODB.Connection


On late bound, the code goes like the way below :


Dim adoConn1 As Object
Set adoConn1 = CreateObject("ADODB.Connection")


I know VB app runs faster in early bound but late bound has benefit too.

Since the project is no longer bound to some particular version of ADO, it will still work, even if we install and upgrade components, no need to re-compile the project (one thing that a must do in early bound).

So now, if someone ask you, which one will you choose :
1. An Early bound app that runs faster but if you upgrade one of your component you have to re-compile it
or
2. A Late bound app that runs slowly but with a higher flexibility on upgrading components?
;-)



 
Hi

I always use early binding except when instantiating MTS objects from a client & RDS objects sitting on server from a client...because I prefer performance which is clearly visible to the client to me recompiling projects when upgrading.

I don't have to recompile my whole project anyway but only a dll because all by development is component based.
As to other components such as ADO etc - Fortunately they never used to be upgraded that often (I see MS is going haywire with MDAC nowadays) & unless I need to upgrade (due to a fault in the earlier version) then I'll continue using the versions that binded to at design time.

I would rather compile (which is not so often) as to a loss in performance.

The bottom line is we as developers have to face the fact that we going to have to recompile our projects sometime. I normally choose that time to upgrade to later versions

Have fun
caf

"I think I am but I know I'm not"
 
My view point is that where possible you should always use early-binding. Performance is better, and robustness is improved. It is also eassier to track down machine configuration problems casuing errors. As an aside, development time is reduced as you get development time errors and intelli-sense help.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Hi Caf & James,
Thanks for your opinion. Like you all, I prefer early binding, especially if I have to deal with client-server application that runs on LAN.

Just want to know what all of you -software developers from around the world- think about early vs late bind method.
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top