Sorting collections at runtime

Discussions about design and architecture principles, including native JADE systems and JADE interoperating with other technologies
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Sorting collections at runtime

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:13 am

by Carl Ranson >> Fri, 5 Mar 1999 2:54:13 GMT

I suppose it wouldn't be too hard to write your own binary tree, hash table, or even btree. each member class (or the data structure class) would have to provide a "lessThan(object) : boolean" and an "equal(object) : Boolean" method.

Of course none of these would be able to take advantage of jades mechanism for setting up memeber keys etc. It may also suffer performance problems.

<whinge>
I've always found it a bit disapointing that Jade hides away the collection types. You would think jade only uses a small set of methods for its automatic update mechanism, and should be able to work data structures other than bTrees.
</whinge>

Carl

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Sorting collections at runtime

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:14 am

by Theodore Taptiklis >> Fri, 5 Mar 1999 4:34:22 GMT
<whinge>
I've always found it a bit disapointing that Jade hides away the collection types. You would think jade only uses a small set of methods for its automatic update mechanism, and should be able to work data structures other than bTrees.
</whinge>


What do you mean by "hides away the collection types"? Do you mean that the collection implementations are hidden? Do you have a need to substitute your own collection implementations?

Theo

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Sorting collections at runtime

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:14 am

by Carl Ranson >> Sun, 7 Mar 1999 22:15:30 GMT
<whinge>
I've always found it a bit disapointing that Jade hides away the collection types. You would think jade only uses a small set of methods for its automatic update mechanism, and should be able to work data structures other than bTrees.
</whinge>


What do you mean by "hides away the collection types"? Do you mean that the collection implementations are hidden? Do you have a need to substitute your own collection implementations?

Theo

Ever noticed how Jade prevents you from adding attributes to collection classes.
Nor can you subclass from those classes. If I wanted to add a BAG (a Set with cardinality of members) class subclassed from BTree I would be stuck.
In theory, if collections wern't treated as special classes by Jade, you could make an inverse that used a binary tree or a hash table or whatever.
I'm not necessarily saying that it would be wise or even pracatical to write a replacement class for Jades collections, I apreciate that this would have implications when you come to things like reorgs. But there are some things that Jade must be doing for collections that could have been useful for the general population.

Take the membership mechanism for instance, this is basically a generic class mechanism, but it is only available to Jade itself. There may have been sound reasons for this decision but other OO languages have this feature and many consider it very useful, especially when dealing with data structures.

Carl

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Sorting collections at runtime

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:14 am

by Craig Shearer >> Sun, 7 Mar 1999 23:28:52 GMT

<snip>
Ever noticed how Jade prevents you from adding attributes to collection classes.

<snip>

I don't know what version of JADE you're using Carl, but I can add an attribute or a reference to a collection classs.

Agreed on not being able to subclass the Btree class though.

Craig.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Sorting collections at runtime

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:14 am

by Carl Ranson >> Mon, 8 Mar 1999 0:31:34 GMT
<snip>
Ever noticed how Jade prevents you from adding attributes to collection classes.

<snip>

I don't know what version of JADE you're using Carl, but I can add an attribute or a reference to a collection classs.


Only to concrete subclasses in your schema, ie not on Collection, Btree, Dictionary etc.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Sorting collections at runtime

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:14 am

by Craig Shearer >> Mon, 8 Mar 1999 0:50:44 GMT
<snip>
Ever noticed how Jade prevents you from adding attributes to collection classes.

<snip>

I don't know what version of JADE you're using Carl, but I can add an attribute or a reference to a collection classs.


Only to concrete subclasses in your schema, ie not on Collection, Btree, Dictionary etc.


but that's the same for all classes - you can't add an attribute or reference to any class that JADE defines in its RootSchema.

Craig.


Return to “Design and Architecture”

Who is online

Users browsing this forum: No registered users and 11 guests

cron