> That was my decision. It's a religious thing I don't expect everyone
> to agree with. I'm firmly in the "exceptions should not be used for
> flow-control" camp. ;-)
>
> The exception being that a get for a specific id should always raise
> because it's an exceptional situation not to find the object then. 
Imho a get for a specific id should also not raise an exception. Just a 
nil please.

Two areas where not finding a result for a specific id is not that 
exceptional:

- even though you have the reference key value, a paranoid bit might 
prevent you from seeing the actual record

- due to lazy loading strategies internally to dm, dm might have a 
reference to a record that existed at the time a collection of ids was 
loaded for an association, but as soon as dm iterates over the 
collection later on, one of the referenced records may have been deleted 
by another user or process. Instead of failing for the whole iteration 
process I'd continue and return a collection where one of its members is 
nil.




Lawrence


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to