What's dynamic to you ?
Thu, Dec 20 2007 0:36
Kathleen left it for others to discuss what dynamic programming means, so I thought I'd utter my thoughts on it here.
Some of the things I consider to be dynamic and of importance are:
- runtime expressions. In days of old for VB/VBScript this was often considered the role of Eval, allowing the user to enter in simple code and have it run. Today, I'd see greater relevance in having queries allowing dynamic expressions, thus allowing the user to filter or build reports over data. So perhaps an expression tree from a string would be more useful than an Eval. Once we have the expression tree we could always compile that if desired.
- dynamic storage types. Part of being able to have dynamic expressions is having dynamic data types for the results. Anonymous types don't really do that because they are compiled as real types. Rather what we'd need is a type that can be expanded, like an expando type. I talked aobut one idea on this a while ago using dynamic interfaces where the properties were as dictionaries,. I'm now thinking perhaps that storage could in fact be XElement and XNodes as they provide the expansion capabilities, the string lookup capabilities as well as a host of other functionality such as event bubbling on change.
- late binding and dynamic invocation. VB already has late binding, although that generally requires you know the method name even though you don't know the object's type. There's also CallByName which is like a reflection based invocation which allows you to specify the method name as a string at runtime. Perhaps a simplified means of invocation would help here. Dynamic interfaces which would allow a confined form of late binding would address the current all or not at all kind of problems with VB's late binding as it stands today.
Still, it's quite surprising to look at VB and see how much of these areas it already has covered or is on the way to :)