On 4 Oct 2009, at 02:27, Dan Kubb (dkubb) wrote:
> I'm not sure this would be completely obvious to a DM user. It would > be like calling a method on an object and having that object removed > from one or more of the Arrays it belongs to. I think both sides can be argued here. There's certainly a sense it making destroy "global", in the sense that destroying a resource should do as much to obliterate it as possible... > It could be argued that > DM should have richer behavior than plain ruby objects, and I would > agree, but at the same time I would want DM to remain ruby-ish with > similar behavior to other ruby libs. I don't think we should have this > behavior be a part of core. ... but on the other hand, if the intention of resources is to appear like pure Ruby objects, it would be inconsistent to do more than destroy the resource itself. (I have a feeling it's safer if DataMapper takes one attitude or the other and applies it consistently.) > Implementing this might not be entirely straight forward either. > Every resource would need to hold references to every single > collection it was ever included within, and tell them to itself when > it is destroyed. I'm not sure what side effects that would have. I > also wonder if there might be GC issues in long running code because > you may have references to collections that normally would've gone out > of scope. Hmmm, would the GC issue be solvable with weakrefs? I can see it being a potential source of nasty bugs though... Anyway you've convinced me this is not an avenue worth exploring in the near future. Cheers Ashley -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
