| Page 1 of 1 | [ 6 posts ] |
|
Since javascript is able to run server side now a days, the need for datastructures grows. Like tree's, linked lists, priority queues,stacks and what more you have.
At least I need it I did a quick search for datastructure libraries on the internet and found that not much is available. The few I found where pretty incomplete. So I decided to write such a lib myself! Is there anybody who can give me some pointers on where to start, what to extend (YUI.Base I guess?) or any information which might come in handy for me... Thanks in advance! |
Juan Ignacio DopazoYUI Contributor
|
Hey Erik! Sounds interesting. You should drop by #yui on IRC so the guys and I can give you better feedback.
|
|
Indeed, you make a good point, while JavaScript was only on the client side, there had never been such an amount of data to justify any effort on data structures; hashes, which are native to JavaScript were often enough. Now, on the server, with no bandwidth limitations, you can't just improvise.
I would not extend Y.Base, I don't think it would be needed and it would be a big expense. YUI does not require its modules to extend any particular base class. I would start from zero not extending anything (which means implicitly extending JavaScript own Object class). YUI will require you to wrap your code into modules, which requires each file to be wrapped in a YUI.add() method so that it identifies itself to the rest of the system. If you plan to make it a YUI Gallery module, the build system does it for you. The build system expects a very specific layout of files so please go to the YUI Gallery section of the documentation and read the documents on how to set it all up. |
Alberto SantiniYUI Contributor
|
Hello Erik.
You may give a look at the following snippet: https://github.com/albertosantini/node- ... ammiNet.js Once you have a graph with nodes containing the "from", "to" and "cost" attributes, it is easy to handle the adjacent list. Hope that helps, IceBox |
|
Thanks for the info so far!
I made a github account, signed the CLA for Yahoo and currently reading on how to create a YUI module for the gallery. I will checkout IRC as soon as possible. I'm a little affraid of native javascript since it can do some counter intuitive stuff which the YUI lib tries to prevent by its core classes. However, a datastructure better be as fast as possible. So I guess I'll follow your advice on that one I'm going to dive in the code example more thoroughly later. It seems promising to me! |
|
I made some progress. If anyone is interested, please criticise!
http://jsfiddle.net/t638403/NdTZN/7/ I implemented Crockford's parasitic inheritence pattern, with shared secrets... (http://youtu.be/DwYPG6vreJg?t=32m59s) Furthermore, does anyone know a good way to work with exceptions in js? |
| Page 1 of 1 | [ 6 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group