jhipster / jhipster-core

JHipster Domain Language, used by JHipster UML and JDL-Studio to generate entities
Apache License 2.0
345 stars 116 forks source link

Move common code to JDL #13

Closed deepu105 closed 8 years ago

deepu105 commented 8 years ago

Move some of the common code to JDL so that we can use it in JHUML and the sub generator This would make JDL act like a parent library kind of thing for all Jhipster projects that requires these info. Another option would be to move all the common reusable code to a new project called jhipster-core what do you think @MathieuAA ?

This can address @MathieuAA request to have some reusable code from JHipster in a module. Though may not be the most intuitive way this could be a viable solution

  1. database attribute types: this can be moved from JHUML to here so that this becomes the reference point for different types used in the generator, JHUML, JDL studio and JDL and if @jdubois and @jhipster/developers are ok then I can refactor the entity sub generator to get the types from JDL while constructing the questions. only downside of this would be that if we need to add a new type we have to add it here rather than adding it directly in the generator, but then it saves us the trouble of updating all different projects to handle the new type
  2. dsl_parser: IMO this can be moved to JDL project, it has dependency on parser_helperand jhipster_option_helper but those are minor util methods which can be either duplicated or moved to this project and referenced in JHUML since it will have JDL as a dependency anyway
  3. ClassScheduler: with the current way of liquibase not being order dependent is this required? if so can it be moved here and referenced from JHUML
  4. EntitiesCreator: can this be moved here as well
MathieuAA commented 8 years ago

I'd make another project instead of putting code here.

deepu105 commented 8 years ago

im fine either way

Thanks & Regards, Deepu

On Tue, Apr 19, 2016 at 9:07 PM, Mathieu ABOU-AICHI < notifications@github.com> wrote:

I'd make another project instead of putting code here.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/jhipster/jhipster-domain-language/issues/13#issuecomment-211917337

MathieuAA commented 8 years ago

@deepu105 What if this module could export JHipster JSON files?

deepu105 commented 8 years ago

@MathieuAA what do you mean. Are you talking about JDL or a new module?

MathieuAA commented 8 years ago

This module. My point is:

deepu105 commented 8 years ago

yes that is what I originally asked for

Thanks & Regards, Deepu

On Thu, Apr 21, 2016 at 1:02 PM, Mathieu ABOU-AICHI < notifications@github.com> wrote:

This module. My point is:

  • It's a JHipster project,
  • It handles the JDL and everything around it (only as input, and everything else as output),
  • Dealing with JSON files from JDL is a task in its scope.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/jhipster/jhipster-domain-language/issues/13#issuecomment-212746190

deepu105 commented 8 years ago

My intention when we started the JDL as a separate project was that it can read JDL files and produce JHipster entity Json as one of the output output. If you remember my original idea was to have the below methods parse function which just gives the pegJs output, this is useful for JDL studio parseToEntity function which outputs Jhipster entity json from JDL (in earlier thread i was calling this parseToJson

deepu105 commented 8 years ago

we had that discussion here https://github.com/jhipster/jhipster-domain-language/issues/1

MathieuAA commented 8 years ago

Yes, I remember but it seemed kind of redundant with what the subgen does. That's why I asked you ;) Anyway, I'll try to do it this week-end.

Le 21 avril 2016 07:26:49 GMT+02:00, Deepu K Sasidharan notifications@github.com a écrit :

we had that discussion here https://github.com/jhipster/jhipster-domain-language/issues/1


You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/jhipster/jhipster-domain-language/issues/13#issuecomment-212750390

Mathieu ABOU-AICHI

deepu105 commented 8 years ago

If JDL does that then I would just use it and remove all that code from subgen

Thanks & Regards, Deepu

On Thu, Apr 21, 2016 at 1:38 PM, Mathieu ABOU-AICHI < notifications@github.com> wrote:

Yes, I remember but it seemed kind of redundant with what the subgen does. That's why I asked you ;) Anyway, I'll try to do it this week-end.

Le 21 avril 2016 07:26:49 GMT+02:00, Deepu K Sasidharan < notifications@github.com> a écrit :

we had that discussion here https://github.com/jhipster/jhipster-domain-language/issues/1


You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub:

https://github.com/jhipster/jhipster-domain-language/issues/13#issuecomment-212750390

Mathieu ABOU-AICHI

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/jhipster/jhipster-domain-language/issues/13#issuecomment-212751949

deepu105 commented 8 years ago

its tracked in #28