Are Lookups via DTML methods efficient?
I have a list of easy-to-remember website names, and hard-to-remember URLs. My goal is that when coding my Zope site using DTML I should be able to refer to a URL by its easy-to-remember website name. I am thinking of creating a near-identical group of DTML methods whose IDs are the website names and whose titles are the URLs. Each method would then return its own title. Is this approach efficient? I could call a SQL database instead, but I think that would be overkill in this case. Also, opening up a connection for this simple information might not be efficient either. Should I use a field index on a catalogue instead? Each website name would only have a single URL, so the search would only return a single value. Could there be an XML approach which might work well? Ultimately I could have hundreds of URLs that I want to call by website name. __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Jonathan Mark wrote at 2002-12-30 09:43 -0800:
... Sure, there are more efficient ways to implement such a mapping. But you may not care. It will probably only a small fraction of the time needed to render your page.
If you do care, you may perhaps look at the TinyTable2 product (I did not do that; thus, it may not help you solve your problem). When I had your problem, I would probably write a manageable (through the ZMI) wrapper around a "BTrees.OOBTree" object. But it is worth only for large mappings (several thousand entries). Dieter
participants (2)
-
Dieter Maurer -
Jonathan Mark