BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Strong Duck Typing Cut from VB 9

| by Jonathan Allen Follow 67 Followers on Apr 02, 2007. Estimated reading time: less than one minute |
Visual Basic's implementation for duck typing, known as Dynamic Interfaces, has been cut from the Orcas release due to time constraints.
 
Duck typing allows the programmers to interchange objects based on what methods and properties they have rather than their type or interface. While this can lead to more reusable code, it also carries the inherit problems with late binding such as invalid cast and missing method exceptions.
 
Dynamic interfaces were defined like normal interfaces, with one key difference. With normal interfaces, the class developer must indicate which interfaces the class implements when the class is compiled. Dynamic interfaces would have delayed that decision. Any class that happened to have all of the correct methods and properties could be treated as having implemented the interface at runtime. In effect, developers can add additional interfaces to a preexisting class that they don't control without sub-classing.
 
For more information on the current plans for VB 9, see the February 2007 Overview of Visual Basic 9.0.
 
 

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

You can achieve the same effect using existing features in VB .Net by Patrick Gleenan

You can achieve the same by combining statically and dynamically typed files.
Check out Statically Typed Wrapper for Dynamic Code patter:
www.codeproject.com/KB/vb/StaticallyTypedWrappe...

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT