Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Enhancement for project/context specific variables #150

Closed
hohwille opened this issue Aug 3, 2015 · 3 comments
Closed

Proposal: Enhancement for project/context specific variables #150

hohwille opened this issue Aug 3, 2015 · 3 comments

Comments

@hohwille
Copy link
Member

hohwille commented Aug 3, 2015

I would like to suggest the following:
Lets assume CobiGen performs a generation on the input X. Currently CobiGen only resolves variables based on the global trigger. However, sometimes X does not contain the input required to resolve all variables. A simple example is access-control-schema.xml that does not contain the application name (neither in path nor in context). So my proposal is:

  • CobiGen does a recursive path traversal on dirname(X) and in each directory up to the filesystem root it collects files named cobigen.properties.
  • CobiGen then creates new Properties() and loads all collected cobigen.properties from the root to the leaf.
  • These properties are added to the properties produced by the trigger.

Now if I have a project I can simply create a cobigen.properties file with this content and check into version control:

appName=myapplication
logicStyle=UseCasePattern
...

With the flexible approach described above I could even override individual properties on package-basis, etc. With this we could solve a lot of problems we are currently facing.

@maybeec
Copy link
Member

maybeec commented Aug 10, 2015

Solution proposal for #72

If I got you right, this property files should be located in the templates folder structure?
This approach a way more flexible than the current context.xml approach.
Nevertheless, the access-control-schema trigger exacly defines a constant as a fixed property for generation, which can be adapted by your project.

We should also take into consideration, thhat it should be easy to maintain the proeprties for a project. Distributing all the properties over a large number of folders and sub-folders, might end up in a configuration hell. Thus, the default should be one properties file in the root.
I will take this into consideration, when designing the templates folder in a more pattern like way in the near future.

@hohwille
Copy link
Member Author

hohwille commented Apr 6, 2016

Nevertheless, the access-control-schema trigger exacly defines a constant as a fixed property for generation, which can be adapted by your project.

My project is following microservices architecture. I have many apps (MS) and thus have many access-control-schema.xml but only one template set with one fixed property.

@hohwille
Copy link
Member Author

hohwille commented Apr 6, 2016

If I got you right, this property files should be located in the templates folder structure?

I was thinking about the folders of the project where to content is generated to, but both approaches have its pros and cons. Maybe you could support both (at least top-level folder of the project should allow to have a config file that is honoured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants