Object Orientation in arrays

xavier.bury at clearstream.com xavier.bury at clearstream.com
Tue Nov 22 02:53:07 EST 2005


hello scripters

Just wondering what scripters feel like about a few possible uses of 
arrays as objects...

Way back in HyperCard, where no arrays existed, we did the good old 
approach

repeat with x = ...
  get item x of anything 
  do "put it into object" & X

Thanks to Scott Raney, we can use arrays today...

But this leads to possible chaos...

For easy cases, pArray[x]...
For specific cases, pArray[thisobject]

BUT, it gets more complicated... Im working on a port of XUL, xml, Css, 
and
a few more things into an ajax paradigm... As you can imagine, the xul 
elements
are a bit more involved, some with "inherited" behaviors which in Rev are 
actual
properties or extra commands...

So, in the end we get xulObjDB["object", ObjID, "property", "Hidden"]...

The problem is that transcript is not that good with multiarray 
management...

For example you can't extract just a list of the objIDs... Not without a 
loop,
the split function will not get you the 2nd column...

There's no way to create the Array without inserting each element into 
it's 
corresponding node. Not that wrappers can't be done but it's quite 
inneficient.

I still have to read on transpose and other array styles (numeric) to see 
if 
there is any other way to do this via indexed/hashed arrays... 

For example:
XULObjs[objID, "name"]
XULObjs[objID, "Type"]

or, in this case where it is easy to get a list of the ids...

XUL[ObjID] = object ID
XULName[ObjID] = name
XUProps[ObjID] = props, etc...

The issues here is that either we have one big array with LOTs of keys or
different arrays to parse each (less keys, but more loops )...

Any ideas on how to make big multidimensional arrays easier to handle?

So, im looking forward to your ideas on which is best given that there's a
tree hierarchy of objects in a xul or xml or html document to be parsed,
each object in the tree nodes has properties, possibly children objects...

And yes, there's possibly hundreds or thousands of objects...

I know how to handle these, that's not the problem. Im wondering if there 
isn't
a better way to handle the arrays and/or which is easier to manage...

Thanks in advance

cheers
Xavier


-----------------------------------------
To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is 'firstname.familyname at clearstream.com'.

Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER



More information about the use-livecode mailing list