Github user ahgittin commented on the pull request:

    
https://github.com/apache/incubator-brooklyn/pull/1138#issuecomment-171271486
  
    well, we should definitely refactor so the added lines are shared code.  i 
will look at cleaning up those pieces as a PR which builds on this.
    
    i don't think it will work nicely to defer wrapping because plans might 
contain multiple entities or they might attach policies etc at the root.  it 
might be nice to have a more elegant solution wrt the `Application` v `Entity` 
split and being clear what the output of the plan parse is -- we expect that 
the *output* of that parse is a single `Application` but the inputs in yaml are 
a *list* of `Entity` objects.  this is a consequence of the camp yaml spec 
which came after the groovy-led brooklyn approach where `Application` was more 
natural.  however wrapping and unwrapping is proving a pretty good way to 
resolve the mismatch, provided we can resolve the issues john raises and 
minimise code duplication.
    
    @johnmccabe regarding your point 2 about adjuncts (policies/enrichers) 
added at the root, i think this necessarily blocks unwrapping because the 
enricher might run over children in which case merging would break it.  i'll 
see if template 4 allows us to put the adjuncts on the child.


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