| Sign In/My Account | View Cart |
| Article: |
Better, Faster, Lighter Programming in .NET and Java | |
| Subject: | Your factory method screws up early binding! | |
| Date: | 2004-07-20 06:30:13 | |
| From: | henkgijsbert | |
| Your factory method screws up early binding. No compile checking anymore. We can just as wel go back to VB6 that way! | ||
Showing messages 1 through 3 of 3.
In addition, you get the binding that matters; the compiled image binds to the methods of the interface directly, without any of that late-binding IUnknown-iness from good old COM, so you don't suffer a performance problem. The only thing you have to do is wrap the call to the factory in a try/catch block in case the reflective lookup fails, and you ought to be double checking any "new" calls anyway.
But, if you don't need future-proofing in your app, don't use the technique. Nothing fits all problems...