BT

Strong Duck Typing Cut from VB 9

by Jonathan Allen on Apr 02, 2007 |
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.
 
 

Hello stranger!

You need to Register an InfoQ account or 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

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT