|
-
Apr 29th, 2003, 04:40 PM
#2
Fanatic Member
I personally like to keep a tight reign on my objects, and only instantiate them when I need to use them, and dispose of them immediately when I am done with them.
However, sometimes this means using late binding vs. early binding - if using polymorphism such as:
Above I decare myObj to be of type object, then at run time I instantiate the object (New) to the type of Object that I wanted (in my case a particular form). This saves me from declaring each form at design time, and then not even using most of them - or at the very least it saves me from typing the declaration of:
Late binding incurrs a performance hit because the compiler can't perform it's optimizations, type checking, and member lookup. So more work has to be done at runtime. However, I don't think the performance hit is significant (although I have not actually tested it, but doesn't seem to slow it down).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|