JaroslavTulach commented on pull request #2948:
URL: https://github.com/apache/netbeans/pull/2948#issuecomment-841031018


   > Passing configurations via `Lookup` represents a hidden API 
   
   Passing configuration via `Lookup` is an API. The same way as passing 
`ActionProgress` and `ExplicitProcessParameters`.
   
   > contract anyway so why not make it official via public API?
   
   `ActionProgress`, `ExplicitProcessParameters` form official and publicly 
documented API. Passing _configuration_ would be public and official as well.
   
   > what is the problem with the `ConfigurationAware` approach. 
   
   It is a novel approach to problems that have been solved differently in the 
past. **Consistency** is important: Is it not enough to follow the 
`ActionProgress` or `ExplicitProcessParameters` approach? What would be missing?
   
   The only example where the _aware approach_ of cloning from a singleton has 
been used I know is `ContextAwareAction`. However, the essential aspect in 
there is related to _property change listeners and enablement_. 
`ActionProvider` doesn't work with such concepts.
   
   Or shall we rather (as a mental experiment) create additional interfaces for 
`ActionProgressAware` and `ExplicitProcessParametersAware` providers? How would 
the **composition** of all such interfaces work? I don't have answers to such 
questions now, but I am scared by the wide range of answers/problems such 
questions may raise.
   
   Another problem of the _aware approach_ is enormous **complications of API** 
on the side of the caller. Calling into `ActionProvider` becomes complicated. 
That's probably caused by mixing API and SPI in the `ActionProvider`to begin 
with, but the need to _clone a copy from a singleton_ before calling makes it 
even more apparent.
   
   `invokeAction` with a `Lookup` was enough for passing 
`ExplicitProcessParameters`. I believe it is going to be enough for passing 
`ProjectConfiguration` as well. 
   
   PS: Pointing out a use-case which would be significantly in favor _cloning 
approach_ may of course open my eyes and change my mind.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to