On 7 Jul 2009, at 10:31, dbussink wrote:
> My biggest issue with this is clarity. Why call save on a specific > resource anyway if it always saves everything? This alone would mean > to me that it should move to another object because it apparently > isn't Resource's concern. Naming methods and putting them in the right > place is of major importance, especially for a framework like > DataMapper. Yes, I agree. I now think that Dan's change as described in [940] is appropriate. An object should only save as much of the object graph is it *needs*, in order to save itself. However, there are still problems with this involving infinite loops and quadratic time saves, at least when before/after filters are used. And, of course, we still need an elegant way to save *everything*. > I agree with providing a Repository#save. Imho it more correctly > confers what it does, since if I would encounter this method for the > first time I'd probably think that it means what it probably does :). > It should possibly use the IdMap for a first try, don't know what the > best case is though for handling code outside a repository block. I don't think this can be solved when not using a repository block. Or at least, my first impression is that it's not worth trying to solve. But I've had a quick go at this using a repository block, and documented the effort in [959]. WDYT? Ashley [940] http://datamapper.lighthouseapp.com/projects/20609-datamapper/tickets/940-datamapper-010-does-not-recursively-save-parent-resources#ticket-940-13 [959] http://datamapper.lighthouseapp.com/projects/20609-datamapper/tickets/959-repositorysave -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ http://twitter.com/ashleymoran --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
