Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-server/pull/482
  
    makes sense although something niggles...
    
    quick things:
    * definitely `@DslAccessible` is clearer for methods
    * maybe `DslFunctionSource` is a better name than `DslCallable` ... though 
feels like this interface shouldn't be needed; we simply skip evaluation in 
`DslDeferredFunctionCall` if `object` is already a valid source for invoking 
`fn` eg `object.getClass().getMethod(fn)` exists and is `@DslAccessible` (or 
maybe we always evaluate, given my re-reading of code, `DDFC` is only created 
when `object` is *not* a `DslCallable` ... or in an annotation world it would 
only be created when `object.fn()` is `@DslAccessible`)
    
    my gut says a cleaner solution would be methods of the form 
`attributeWhenReady(Entity source, String sensorName)` and we do "C++ on C" 
style caller injection into the first argument.  this would solve the issue you 
mention where e.g. 
`attributeWhenReady("target.cluster.entity").attributeWhenReady("size")` isn't 
supported.  it's a bigger change perhaps than wanted at this point so happy to 
defer but let's keep that in mind and any interfaces or annotations we 
introduce along the way probably mark beta.
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to