-
Notifications
You must be signed in to change notification settings - Fork 77
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
Support scaffold Spring Boot components #767
Comments
Hi! Following with the scaffold idea, I would like to attach some screenshots. In the first picture I created by hand a sample bunch of directories with one file inside each one related to the function they were created for. (Imagine it has been generated with a context menu item named for example "Generate Initial Java Scaffold API" supposing I right-clicked in the named "rest" folder of the following image example): The feature should open a command palette modal and ask to the user what will be the entity name to be applied in any related file generated, for example: SampleNameEntity, SampleNameController, SampleNameService, SampleNameDTO,... The initial code by default could be empty methods with the params names replaced by the required entity name from before: NOTE: In the following pictures you will see default templates generated by the plugin Spring Code Generator developed by the author Sonal Sithara. His plugin saves a lot of time typing general methods and let user focus on the logic development and not in the code structure. CONTROLLER: SERVICE IMPLEMENTATION: SERVICE INTERFACE: REPOSITORY: ENTITY: RESUME: The idea would be a context menu option which open a command palette modal to insert the shared EntityName. Then the tool will create the required mkdirs and generate inside of each one the file templates according to each folder functionality. BONUS: Would be great a second modal question for the user before to start generating the scaffold (optional) which ask for Lombok Dependency integration and generates the initial entity template according to this choice. |
Thank you @BizarreBoy for providing those detailed information. BTW, just for asking, do other Java IDEs/tools provide feature similar to this one? If there is, we can take a look and make it as a reference. |
Glad to help you, @jdneo ! In my experience I have been a user of Eclipse IDE, Vscode and IntelliJ and I didn't find any similar tool. However the idea is not too different from the initial "java create project" feature where the palette command makes few questions before to start generating. The main idea of feature I suggested you is based on a vscode plugin dedicated to Angular developers named "Angular Schematics" developed by Cyrille Tuzi. It works exactly how I described you in my first comment and makes sure the user respect a logic project structure from begining to end. Generates the minimun and necessary starter templates to develop from zero just right clicking in the choosen root directory. Let me know if the attached references could help you. |
Thank you. The idea is clear. But we need to think more about how to make the generated structure be suitable to users project as much as possible. (or, make it be easy to configure/customize) |
I agree, in my opinion we could take the angular schematics plugin as reference. |
Wow!!! Amazing job by copilot! And yes, Spring Code Generator works similar, the only thing it doesn't create is the folder structure and only generates files one by one which is comfortable in most scenarios but a bit annoying when user has to create a full APIREST from zero. This is the reason why I focus on Angular Schematics reference. But it's true that Java Scaffold should work different because Springboot users need the main scaffold just one by project/microservice: Controllers | BussinesLogic [ Services | Interfaces ] | Models [ Entities | DTO | DAO(Repositories) ]. Once the main scaffold is created, the tool should work exactly as Spring Code Generator plugin and add the other templates one by one as the user needs. Let me know your opinion about the functionality/workflow I described you. |
i.e.
Automatically command palette/modal triggers and ask you for the entity name which will be applied in the following generated files inside they respective folders: Controllers/[EntityNameController.java] || BusinessLogic/Services/ServiceImpl [EntityNameServiceImpl.java] || BusinessLogic/Services/ServiceInterfaces[EntityNameService.java] || Models/Repositories/[EntityNameDao.java] || Models/Entities/[EntityName.java]
Maybe need some integration tasks to do with the spring extension.
The text was updated successfully, but these errors were encountered: