Hi all,

I'm working on the usage of external config in catalog definition.

Here is an example:

*brooklyn.catalog:*










*  id: mysql  version: 1.0  description: A MySql server  displayName:
Mysql  iconUrl: classpath:///mysql-logo-110x57.png  itemType: template
brooklyn.libraries:  - $brooklyn:external(A, B)  item:    services:*


*    - type: brooklyn.entity.database.mysql.MySqlNode*
For the value of *'item' *there is working code that parses the '$brooklyn'
tag.
So we are interested in the other keys.
As there is no recursion for them, the best approach is to parse each value
and if it contains the tag, to replace it with the object returned from the
parser or leave it unchanged otherwise.

*Here comes a problem.* *DslParser* is in *brooklyn-camp* module, which
depends on *brooklyn-core*.
I need to use it in *BasicBrooklynCatalog *which is in *brooklyn-core* but
cannot depend on *brooklyn-camp*.

There is similar PR (#1112
<https://github.com/apache/incubator-brooklyn/pull/1112>) to support
external config in *BrooklynProperties*, were there is no recursion, but it
is used from classes in the* brooklyn-camp* module.


One approach is to write similar parser out of the camp module, but this
means too much repetitive code.

The other is to move *DslParser *out of *brooklyn-camp*, which looks the
best for the future.

I am writing now a small parser for the catalog only in order to introduce
the feature and we can remove it after refactoring as moving *DslParser *is
bigger task.

Could you give some advice or share opinion?

Best,
Ivana

Reply via email to