Berin Loritsch wrote:
Antti Koivunen wrote:

<snip/>

I think you misunderstand the ability of what the proxy can do.  The
container can have a "timeout" for component inactivity, and
automatically reclaim resources.
Yes, I know it can be done. However, only the client knows _exactly_
when a resource can be released, so for optimal performance, it should
have a way of communicating this to the container.

The best we could do with a proxy, would be to have an adaptive implementation that monitors the usage of a particular component, and
attempts to optimize the access accordingly. However, this is, by definition, never as accurate (but undoubtedly sufficient in most cases).

Anyway, I do agree that it would be more elegant and convenient to use
only proxies, but somehow it doesn't feel right to add complexity to the
container, knowing that the solution still wouldn't be optimal. But I do understand the benefits and I'm open to any ideas.

I am thinking of using dynamic proxies for other things, though, such as
to ensure high availability. For example, the container could be enabled
to take action if a certain operation doesn't complete in a reasonable
time, or throws a technical exception, etc. So, it certainly wouldn't
hurt have a uniform way of adding interceptors to method calls, which would in turn enable a bunch of other cool things :)


 For components that need to maintain
state, there needs to be a mechanism to store and retrieve that
state information--but that also can be handled invisibly to the
client.
Yes, naturally it should be invisible to the client. What I had in mind
was something like:

  void calledBeforeAnInstanceAquiredByTheClient(); // Handle.access()
  void calledAfterTheInstanceIsReleased();         // Handle.release()

This would enable the component to easily manage things spanning one
request. But again, I'm sure this is not perfect, and I'd like to hear
other suggestions.

(: A ;)
--
Antti Koivunen (Mr.) <[EMAIL PROTECTED]>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to