2017-09-10 13:58 GMT+02:00 André Pönitz <[email protected]>: > On Sun, Sep 10, 2017 at 11:31:58AM +0200, Elvis Stansvik wrote: >> As soon as I hit send, I realized I have a third question: >> >> 3. Communication Between Plugins: >> >> There seems to be two main mechanisms through which plugins >> communicate: Either objects that implement shared interfaces are added >> to the plugin manager object pool and picked up by downstream or >> upstream plugins (in the top-down or bottom-up phase of plugin >> initialization, respectively), or a singleton instance is acquired and >> calls made on it. >> >> Is the former approach used when dependants provide functionality to >> their dependees (which are unknown), and the latter approach used when >> dependees use their dependants (which are known)? Is that the deciding >> factor? > > I am not sure there is a strict deciding factor or even policy. > There are certainly historical and personal aspects involved. > > The object pool has some systematic quadratic behaviour built-in, > so even if it is still ok, it won't scale arbitrarily. So I am > trying to reduce it's use in well-known cases where one side > depends on the other anyway, e.g. replace various factories > hat so far ended up in the pool with explicit registration of > their upstream users, and only use the pool where it's flexibility > is really needed.
Okay. That makes sense. I think I completely missed one aspect here, which what you said made me realize: A plugin could provide something for another without depending on it. In my mind I always thought of the situation where one plugin depends on another (the interface being implemented is in that other plugin) and adds something to the pool. But I realize now that the interface could be in a third plugin upon which they both depend (the user and the provider plugin). But there's no dependency between them. So now I see what you mean with "where one side depends on the other anyway". Do you think in general the pool should only be used if the provider plugin does not already depend on the user plugin? Elvis > > Andre' _______________________________________________ Qt-creator mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qt-creator
