I agree this is sensible to convey to users. You make a clever point - about destroy() not being a part of existing RMs, so no existing code would break.
I find your arguments convincing :-) I'll put in a Jira for this. Thanks. -Marshall On 10/24/2016 10:25 AM, Richard Eckart de Castilho wrote: > If an RM is implicitly created, then I would consider the AE that implicitly > created the RM the owner of it. If a user obtains that RM and passes it on, > then that must be under the consciousness that the user is *not* the owner. > > If the user wants to be the owner of an RM, then the user should create it > and pass it to the AE in the first place. > > Do you think this is not sensible/conveyable to users? > > Since so far, RMs did not support destroy at all, I believe it should also > not break existing code if we implement it in this way. > > Best, > > -- Richard > >> On 24.10.2016, at 16:16, Marshall Schor <[email protected]> wrote: >> >> Resource Managers are not always implicitly created by the framework. >> Sometimes, users create RMs exactly for the purpose of having some parts of >> them >> shared among multiple pipelines / resources. >> >> A possible use case: >> * user code calls UIMA framework which creates RM as a side effect of user >> calling produceResource (or one of its specializations, e.g. >> produceAnalysisEngine). >> * user gets that RM, and then passes it to another produceResource call. >> >> So we have mixed ownership: the first call the framework created the RM, the >> 2nd, the RM was passed in by the user. >> >> When the use "destroys" (for example) the Analysis Engine produced by the >> first >> call a simple approach would be to destroy its RM, but that could break the >> second use. >> >> -Marshall >
