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

Allow users choices for starter code #168

Open
m-reza-rahman opened this issue Dec 18, 2022 · 5 comments
Open

Allow users choices for starter code #168

m-reza-rahman opened this issue Dec 18, 2022 · 5 comments
Labels
enhancement New feature or request high-priority High priority issue

Comments

@m-reza-rahman
Copy link
Contributor

m-reza-rahman commented Dec 18, 2022

The Basics

The Starter UI will provide the user a set of sensible choices for the generated starter code. The initial set of choices will be as following:

Please choose the type of application*:

(*) Simple RESTful service ❶ ( ) REStful CRUD service ➋ ( ) CRUD web application ❸

❶ The default option. Simply generates a RESTful endpoint that prints {“hello”:”world”} in application/json format. Pretty much just Jakarta REST and JSON. No tests included. See here for reference (pretty much already done): https://github.com/m-reza-rahman/starter/tree/master/minimal-starter.

➋ Generates CRUD REST service with just one simple Entity. Shows sample usage of Jakarta REST, JSON, CDI, Persistence, Transactions/Enterprise Beans and Validation. An embedded database is used for convenience (ideally the default one already included in the runtime). A helpful sample test included. See here for reference (pretty much already done): https://github.com/m-reza-rahman/starter/tree/master/rest-starter.

❸ Generates CRUD Faces web application with just one table/screen and one simple entity. No REST endpoint is included. Shows sample usage of Jakarta Faces, CDI, Persistence, Transactions/Enterprise Beans and Validation. An embedded database is used for convenience (ideally the default one already included in the runtime). A helpful sample test included.

The Next Step

After this initial version is completed, the Starter UI may provide other options to further customize the starter code as follows:

Please choose the type of application:* ❶

(*) RESTful service ➋ ( ) web application ❸ 

Please choose features to include:

[ ] Persistence ❹ [ ] Validation ❺ [ ] Test ➏

❶ User must choose either a REST or Faces web interface for the generated application. The choices are radio buttons.
➋ If Persistence is not selected, simply generates a RESTful endpoint that prints {“hello”:”world”} in application/json format. If Persistence is selected, generates CRUD REST service with just one simple Entity. Shows sample usage of Jakarta REST, JSON, CDI, Persistence and Transactions/Enterprise Beans. An embedded database is used for convenience (ideally the default one already included in the runtime).
❸ If Persistence is not selected, simply generates a basic page that prints “Hello World from Jakarta EE”. If Persistence is selected, generates CRUD Faces web application with just one table/screen and one simple entity. No REST endpoint is included. Shows sample usage of Jakarta Faces, CDI, Persistence and Transactions/Enterprise Beans. An embedded database is used for convenience (ideally the default one already included in the runtime).
❹ Determines if the sample code should be “hello world” or CRUD.
❺ Only activated if Persistence is selected. Otherwise grayed out. If selected, add validation to Entity as well as REST endpoint or Faces backing bean.
➏ If selected, include a helpful sample test.

Later on

Further in the future, more use cases/technologies may be added as options:

[ ] Security [ ] Messaging [ ] Mail [ ] Batch [ ] WebSocket

@m-reza-rahman m-reza-rahman added enhancement New feature or request high-priority High priority issue in-progress Being worked on now labels Dec 18, 2022
@m-reza-rahman
Copy link
Contributor Author

The current consensus is that this is a priority item to be implemented soon. Concise input from key community members can be found here: https://docs.google.com/spreadsheets/d/1bthiYVjX_UK7Xp2qQmq93awPwVhVCDnprGdzeMtv_ow/edit?usp=sharing. A discussion thread on the mailing list can be found here: https://www.eclipse.org/lists/starter-dev/msg00184.html.

@m-reza-rahman
Copy link
Contributor Author

I believe it is important to be deliberate about avoiding too much overlap with the examples project (though clearly there is some overlap): https://github.com/eclipse-ee4j/jakartaee-examples. Both are separate use cases. It's best we focus on the basic getting started experience mostly for beginners and leave less common/more advanced features/options to the examples project instead.

@OndroMih
Copy link
Contributor

OndroMih commented Dec 19, 2022

I think all options should be allowed at any time and never grayed out. For example, Bean Validation could be used even without persistence, e.g. inside a REST resource like here: https://dzone.com/articles/bean-validation-in-jax-rs. I believe that a variant for Faces is also easy to create in a similar way.

@geziefer
Copy link
Contributor

It's best we focus on the basic getting started experience mostly for beginners and leave less common/more advanced features/options to the examples project instead.

I totally agree. That's what the starter is for, to get a qucik start, especially for new or less experienced people.
It should contain the project structure, the runtime, a test, some basic code examples and a readme with some useful information on how to continue from there. Everything else should be left to a broader example project showing all the relevant Jakarta EE technologies which can then be added to ones project as needed.

@OndroMih
Copy link
Contributor

It's best we focus on the basic getting started experience mostly for beginners and leave less common/more advanced features/options to the examples project instead.

I agree that this is the main focus, to aim at beginners to get started with Jakarta EE quickly. But I hope Starter is there also to help experienced devs to be more productive with Jakarta EE. Therefore in the future, I'd like it to provide examples of more advanced stuff like web.xml, beans.xml, orm.xml (Persistence), as these and some other pieces are not well documented and it's hard to find simple examples. For example, I had to note all the standard persistence.xml options in my blog so that I can easily find them when I need them: https://ondro.inginea.eu/index.php/properties-and-config-in-persistence-xml/. What is also hard to find is XSD schemas for various XMLs, even for persistence.xml, or when you want to create CDI beans.xml from scratch (if your IDE doesn't help you well enough). I like the idea that as an experienced developer, I could go to the Starter and generate an example, from which I can then copy to my project.

@m-reza-rahman m-reza-rahman removed the in-progress Being worked on now label Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high-priority High priority issue
Projects
None yet
Development

No branches or pull requests

3 participants