I've a question about the Delegate Pattern :
If I want to delegate the parsing of a xml file, for instance, that I want to be converted into a Key-value Dictionary. Let's take this classical example...
What's the best practice about the creation of that Dictionary Object?
- Is it the "main" object that creates it and pass a reference to it to the delegate, asking him to fill it up,
- Is it the delegate that create this dictionary add pass it back to the "main" object, when he has done his job, trough the return value of the call-back method (or any other way)
Is one of this two ways really better than the other ? And why ?