Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/595#discussion_r28326207
  
    --- Diff: docs/guide/yaml/yaml-reference.md ---
    @@ -142,11 +145,17 @@ However you can combine locations using `multi`:
     Dependency injection other powerful references and types can be built up 
within the YAML using the
     concise DSL defined here:
      
    -* `$brooklyn:component("ID")` refers to a Brooklyn component with the 
given ID; you can then access the following subfields:
    -  * `.attributeWhenReady("sensor")` will store a future which will be 
blocked when it is accessed,
    -    until the given `sensor` from the component `ID` has a "truthy" (i.e. 
non-trivial, non-empty, non-zero) value
    -  * `.config("key")` will insert the value set against the given key at 
this entity (or nearest ancestor);
    -    can be used to supply config at the root which is used in multiple 
places in the plan
    +* `$brooklyn:attributeWhenReady("sensor")` will store a future which will 
be blocked when it is accessed,
    +  until the given `sensor` from the component `ID` has a "truthy" (i.e. 
non-trivial, non-empty, non-zero) value
    +* `$brooklyn:config("key")` will insert the value set against the given 
key at this entity (or nearest ancestor);
    +  can be used to supply config at the root which is used in multiple 
places in the plan
    +* `$brooklyn:sensor("sensor.name")` returns the given sensor on the 
current entity if found, or an untyped (Object) sensor;
    +  `$brooklyn:sensor("io.brooklyn.ContainingEntityClass", "sensor.name")` 
returns the strongly typed sensor defined in the given class
    +* `$brooklyn:component("ID")` refers to a Brooklyn component with the 
given ID; you can then access the following subfields,
    --- End diff --
    
    Ah, I see from this (and the code) that if you omit `component("ID")` then 
it refers to this entity.
    
    I'd prefer our examples here to include component, such as 
`$brooklyn:component("ID").config("key")`. I believe that is the most common 
usage, so that is what we should show people (e.g. they'll want to copy-paste). 
We can then say that if you omit `component(...)` then it defaults to referring 
to this entity. We can also move the definition of `$brooklyn:component(...)` 
to be first.


---
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