[ng-dhtml] Component/Widget data and metadata modelling

Tom Trenka ng-dhtml at dept-z.com
Thu Sep 9 13:32:05 CDT 2004

Off the top of my head, I would say that data structures that components represent should be independent from the component...I would also say that we should probably devise an "interface" that any data structure someone designs can automatically be "hooked" up to the component itself.  I don't think we need to get crazy with Bindings or anything like that, though; probably something to the effect of:

function IUserInterfaceData(){
    this.value = null;
    this.title = null;
    this.abstract = null;
    this.getValue = function(){};
    this.setValue = function(v){ };

For the coder to implement this, they can go one of two ways:
1.  Simply create the object constructor, with each property/method implemented;
2.  Inherit/apply the defined interface to the constructor in question, and implement the methods, like so:

function myDataStructure(...){

After all, what you're talking about really *is* the whole point of using an interface, is it not?

As far as data transfer goes, we have one of two basic options:  implement a number of different pipeline mechanisms, and let the dev choose which one they'll be using; or implement a propreitary one, and let the server dev code against that.  I've done both approaches, and frankly one is as good as another (aside from the proprietary nature of the second choice, of course).  But in the end, it comes down to creating a number of serialization formatters, and probably that's what we should concentrate on when we get to that point.

As for the third, I'm open to suggestions.  If it's to be a markup interface, the only thing I ask is that we XML namespace it; I know that XML namespacing is not yet where it should be, but in this case I think it's better to plan for the future than to ignore it and end up having to radically alter it later on.


---------- Original Message ----------------------------------
From: "Dylan Schiemann" <mail at dylans.org>
Reply-To: discussion on the future of DHTML <NG-DHTML at netwindows.org>
Date:  Thu, 9 Sep 2004 10:09:18 -0800

>Alex and I revisited the discussion of the structure of a generic component yesterday.  Some of the issues we should try to address now and lock down are:
>- data structure (common default data structure, or unique type for each component, or set of data structures independent of component type)
>- data transfer (xmlHttpRequest, real-time (mod_pub_sub), etc. ... how do we want to abstract this, what are the event models going to be, etc.)
>- markup structure (on the wire representation, client side consumption structure, component declaration language, and how packaging will deal with this)
>Let me know what you all think about this stuff when you get a chance...
>NG-DHTML mailing list
>NG-DHTML at netwindows.org

More information about the NG-DHTML mailing list