On Jan 6, 2007, at 8:55 AM, Theodore H. Smith wrote:

To be honest, I can't remember another situation except for trees where I actually needed weak refs. Well maybe a double-linked list... but my tree is essentially a double linked list with a bit ontop.

I have a quite nice Object-Relational mapping layer. Part of the task of this is that if you ask for the objects representing some selection of records, you want to generate new ones if needed, but you want to return existing ones if they've already been instantiated.

So I need a dictionary mapping table-primary key pairs to objects. Fortunately, my current application works quite happily with never removing something from memory once it's been instantiated. But if I ever *wanted* to be able to remove these objects from memory, I would need to either do what amounts to explicit memory management, or have weak references for the aforementioned dictionary.

Probably most generalised high-level frameworks like this would need to have some such dictionary or other list of instances kept somewhere.

Regards,

Guyren G Howe
Relevant Logic LLC

guyren-at-relevantlogic.com ~ http://relevantlogic.com

REALbasic, PHP, Ruby/Rails, Python programming
PostgreSQL, MySQL database design and consulting
Technical writing and training


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to