I indeed ran into the namespace problem... But I really don't think you need to abandon prototype because of it... You just need to develop and apply a sound process for handling all your jScript libraries. I used prototype as my baseline library. For any other frameworks that get added to my projects I first check for any possible namespace collisions (I always check new libraries for faulty code and optimization points anyway so this is a fairly easy step, albeit tedious). If the new library has any namespace contention problems, I simply rename those functions and/or apply a new namespace (if possible). If the function is in complete conflict with prototype or another library (or is redundant), I have no problems just removing it altogether, carefully making sure nothing gets broken and fixing anything that does.
This can definitely lead to small problems with maintenance and upgrades of these other libraries, but I've only really run into 1 instance of a namespace collision. When it comes to javascript libraries though, I really have no problems customizing them to fit my implementation needs... just some food for thought. Remember, no matter how complex and object oriented we make these libraries, they are still just scripts (not compiled optimized binaries), so they are flexible and malleable. Do what you need to do to them to make the whole thing work for you. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Marinschek Sent: Tuesday, January 03, 2006 10:51 AM To: [email protected] Subject: [Rails-spinoffs] Status of Prototype Hi *, we are using prototype in Apache MyFaces as our javascript library of choice. Recently, there has been much discussion on our mailing list as to the usability of prototype in a dynamic environments where several javascript libraries are used. The critics of prototype argue that the prototype objects are not namespaced - and that prototype extends basic javascript-objects with method names that could easily be duplicated by another framework. Is there a line of defense for prototype here that I can use? I really don't want to move everything over to dojo or some other library... regards, Martin _______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. _______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
