On Thu, Oct 9, 2008 at 10:20 AM, Simon Kitching <[EMAIL PROTECTED]> wrote:
> Hi,
>
> As all of you who carefully read commit-messages may have seen (:-),
> yesterday I committed the ability to call
>  Conversation.bind(instance)
> so that later calls to any method on that instance will run within the
> context of the specified conversation (including its associated persistence
> context if any) [1].
>
> This is useful functionality and I don't think anyone will object. There is
> one question about the actual implementation, though, that I thought people
> might have an opinion on.
>
> The current approach adds interface ConversationBinder, and a setter method
> has been added to the Conversation class. Each dependency-injection-specific
> layer then provides a different implementation of this (eg
> SpringConversationBinder) when creating Conversation instances.
>
> An alternative would be for each dependency-framework to instead return a
> subclass of Conversation, then the binder interface would not be needed.
> This approach would potentially be more extensible in future (any future new
> features requiring tight couplings between conversation and
> dependency-injection-framework can just be added transparently without new
> interfaces) but would make the Conversation class a little harder to
> understand IMO.

from what I read, I think I like this second option more, since it promises
a better, more extensible, approach.

>
> Both seem reasonable to me; anyone got arguments about preferring one over
> the other? Or any other issues about those patches in general?
>
> [1] Mario came up with this idea, and did an initial prototype.

Mario, we miss you!

-Matthias

>
> Regards,
> Smion
>
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Reply via email to