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

[Feature] Create new, small sub-generators for Spring Boot #6440

Closed
jdubois opened this Issue Sep 30, 2017 · 8 comments

Comments

Projects
None yet
6 participants
@jdubois
Member

jdubois commented Sep 30, 2017

Our "jhipster entity" sub-generator generates a complete CRUD entity: that's good for a lot of reasons, but sometimes you just want to create a simple REST service. Not everything is a CRUD :-)

If you want smaller components:

  • We already have the "jhipster service" sub-generator, which generates a Spring service bean
  • On the client-side, you can use Angular CLI to generate components, routers, etc...

I would like to:

  • Add a new "jhipster spring-controller" sub-generator, which generates a simple Spring MVC REST controller
  • Rename the "jhipster service" to "jhipster spring-service"
  • Think about other use-cases: a "jhipster jpa-repository"?

This would be an easy work, which shouldn't have much impact elsewhere, but which could help a lot of people.

@atomfrede

This comment has been minimized.

Show comment
Hide comment
@atomfrede

atomfrede Sep 30, 2017

Member

Could be a good thing for hacktoberfest

Member

atomfrede commented Sep 30, 2017

Could be a good thing for hacktoberfest

@deepu105

This comment has been minimized.

Show comment
Hide comment
@deepu105

deepu105 Sep 30, 2017

Member

@jdubois how about containing everything in a parent sub gen (Of course code wise each will be separate and we will just compose it from the parent) so that users don't have to remember every sub generator and it will be easier to advertise and drive adoption.
I propose jhipster component which will ask the below question

What would you like to do?
1. Generate an entity
2. Generate a Spring service
3. Generate a Spring controller

Based on the answer we will just compose the appropriate sub gen and it will take it from there asking additional questions if any and generating the stuff

Advantages of this

  • Easier for people to remember
  • Easier adoption otherwise the option goes unnoticed like our Service generator which is rarely used
  • Possible to add more complex options like Generate a Spring controller with service for which we will just compose the controller sub gen followed by the service sub gen
Member

deepu105 commented Sep 30, 2017

@jdubois how about containing everything in a parent sub gen (Of course code wise each will be separate and we will just compose it from the parent) so that users don't have to remember every sub generator and it will be easier to advertise and drive adoption.
I propose jhipster component which will ask the below question

What would you like to do?
1. Generate an entity
2. Generate a Spring service
3. Generate a Spring controller

Based on the answer we will just compose the appropriate sub gen and it will take it from there asking additional questions if any and generating the stuff

Advantages of this

  • Easier for people to remember
  • Easier adoption otherwise the option goes unnoticed like our Service generator which is rarely used
  • Possible to add more complex options like Generate a Spring controller with service for which we will just compose the controller sub gen followed by the service sub gen
@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Sep 30, 2017

Member

@deepu105 Yes but that's just another sub-generator which is a "wrapper" of the others - no big deal here!
For my personal use-case, I'd rather have "jhipster spring-controller", I find it easier and quicker to use (and that would still be possible, so no problem).

Member

jdubois commented Sep 30, 2017

@deepu105 Yes but that's just another sub-generator which is a "wrapper" of the others - no big deal here!
For my personal use-case, I'd rather have "jhipster spring-controller", I find it easier and quicker to use (and that would still be possible, so no problem).

@ramzimaalej

This comment has been minimized.

Show comment
Hide comment
@ramzimaalej

ramzimaalej Oct 3, 2017

Contributor

I like the idea, this is similar to what Grails has and offers a good level of granularity of what will be generated. It happened to me to delete all the UI part for a given entity because it was not needed.
I would prefer a different command than answering questions like @jdubois mentioned.

Contributor

ramzimaalej commented Oct 3, 2017

I like the idea, this is similar to what Grails has and offers a good level of granularity of what will be generated. It happened to me to delete all the UI part for a given entity because it was not needed.
I would prefer a different command than answering questions like @jdubois mentioned.

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 4, 2017

Member

Yes: at the beginning Grails (and RoR!!) where heavy sources of inspiration, we are going back to roots :-)

Member

jdubois commented Oct 4, 2017

Yes: at the beginning Grails (and RoR!!) where heavy sources of inspiration, we are going back to roots :-)

@clarenced

This comment has been minimized.

Show comment
Hide comment
@clarenced

clarenced Oct 10, 2017

Contributor

Hi @jdubois I am interested in this feature !!!

Contributor

clarenced commented Oct 10, 2017

Hi @jdubois I am interested in this feature !!!

@clarenced

This comment has been minimized.

Show comment
Hide comment
@clarenced
Contributor

clarenced commented Oct 11, 2017

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Oct 18, 2017

Member

Closing as we have a "spring-controller" sub-generator that was commited in the last release.

Member

jdubois commented Oct 18, 2017

Closing as we have a "spring-controller" sub-generator that was commited in the last release.

@jdubois jdubois closed this Oct 18, 2017

@jdubois jdubois added this to the 4.10.1 milestone Oct 25, 2017

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