Nice TWiki > Dev > DynamicMembers (r1.6 vs. r1.7) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Dev . { Changes | Index | Search | Go }
 <<O>>  Difference Topic DynamicMembers (r1.7 - 13 Nov 2003 - TroyHeninger)
Changed:
<
<

-- TroyHeninger

>
>

-- TroyHeninger - 11 Nov 2003

Added:
>
>

Worthy Examples

I can think of three examples off the top of my head: web programming, database programmin, XML programming, and properties. I'm sure there are many more. Let me illustrate each of these, though I don't have time at the moment to be thurough. I'll add more later...

Web Programming

When your page or servlet receives an HTTP request, instead of getting a simple javax.servlet.Request object, you would get a DynamicMember. All variables passed thru the URL (using GET) or thru a form (POST) would be available as runtime members of thi object. Also, the session object would be a DynamicMember, so that it's members were set at runtime throughout the life of the session. In a language I designed a few years ago, I also had properties attached to web folders/applications, and the servlet's init parameters that both used the DynamicMembers concept. I also had a temp object for each page that was dynamic, that wouldn't get passed in calls to other pages.

Database Programming

Each ResultSet? object should also be a DynamicMember so that each column can easily be accessed or changed as if it's part of the language. I referred to this idea in the introduction above.

XML Programming

XML would be a natural for this. Each Node would be a DynamicMember so that child nodes could be easily accessed, added, changed, or removed at runtime.

I'll add example code, if you need, when I have a little more time. But I hope I've opened your eyes to the possibilities.

-- TroyHeninger - 13 Nov 2003


Topic DynamicMembers . { View | Diffs | r1.8 | > | r1.7 | > | r1.6 | More }
Revision r1.6 - 12 Nov 2003 - 22:08 GMT - DanielBonniot
Revision r1.7 - 13 Nov 2003 - 22:52 GMT - TroyHeninger
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.