MicroProfile starter - should list beans.xml on the site

29 views
Skip to first unread message

Emily Jiang

unread,
Mar 11, 2019, 8:42:47 AM3/11/19
to Eclipse MicroProfile
On the MicroProfile starter, (https://start.microprofile.io/), the beans.xml is listed on the generator page. I am wondering how useful it is. I brought this up in MicroProfile starter issue with the following 2 questions?


Does people change the setting or bother to choose anything different other than the default?
Does people understand the consequence of choosing a different value for bean discovery mode?

I wonder whether displaying beans.xml add more confusion or white noise to the generator. Should we choose a sensible default and stay with it and remove the beans.xml entry?



The response so far is to remove the entry of beans.xml on the starter and give it a default for beans.xml entry.


As for default value for the beans.xml entry, there are two possible suggestions:


  • Option A: Don't generate beans.xml
    cons: Any newly added classes need to have bean-defining annotations. Otherwise, the injection will not work.
    pro: less files, bean-defining annotations are carefully considered and added to a particular resource.

  • Option B: Generate beans.xml with bean discovery mode with "all"
    cons: more files are generated and the relevant scopes might not be considered.
    pros: All injection will work.


I would like to bring this issue to this mailing list to get more votes. Please voice your opinion on:

1. keep beans.xml? Yes or No

2. If the answer is No, should the default is option A or option B?


Thanks

Emily



Gavin King

unread,
Mar 11, 2019, 8:54:55 AM3/11/19
to microp...@googlegroups.com
On Mon, Mar 11, 2019 at 1:42 PM 'Emily Jiang' via Eclipse MicroProfile
<microp...@googlegroups.com> wrote:

> 1. keep beans.xml? Yes or No

Yes. It's how CDI was intended to be used.



--
Gavin King
Red Hat

Emily Jiang

unread,
Mar 11, 2019, 10:56:56 AM3/11/19
to Eclipse MicroProfile
Well, for someone who understands CDI, it makes sense. However, if we can use a sensible default, the site can be further simplified.

As a side note, I do worry for a lot of users, this beans.xml is too low level. If we come up with sensible default, the starter tool will be less confusing.


See some discussion on the issue I mentioned:
From Andy, Kevin :

I felt the same way the first time I had a look at the website. All the rest of the options are extremely high-level (what java version, what technologies do you want to use, what app server).

The beans.xml is a very low-level detail in comparison to the other items, and feels out of place.

+1 for just giving the user the default


For somebody that is using the starter in the first place, the prompt for the beans.xml is overkill and confusing. Default it and skip the the prompt.

Emily

Ladislav Thon

unread,
Mar 11, 2019, 11:31:24 AM3/11/19
to MicroProfile
po 11. 3. 2019 v 13:42 odesílatel 'Emily Jiang' via Eclipse MicroProfile <microp...@googlegroups.com> napsal:

1. keep beans.xml? Yes or No

No. I totally agree it looks strange in the generator. Please remove the option.

2. If the answer is No, should the default is option A or option B?

I would personally lean towards A, but there's also C: generate beans.xml with discovery mode "annotated" (I know it's just like A, but it is technically a separate option :-) ).

LT

Gavin King

unread,
Mar 11, 2019, 12:22:05 PM3/11/19
to microp...@googlegroups.com
Oh perhaps I've misunderstood the question.

If the option was:

> 1. keep beans.xml as an explicit option in the generator

Then I would say no. Just generate an empty one by default.

On Mon, Mar 11, 2019 at 3:56 PM 'Emily Jiang' via Eclipse MicroProfile
<microp...@googlegroups.com> wrote:
>
> Well, for someone who understands CDI, it makes sense. However, if we can use a sensible default, the site can be further simplified.
>
> As a side note, I do worry for a lot of users, this beans.xml is too low level. If we come up with sensible default, the starter tool will be less confusing.
>
>
> See some discussion on the issue I mentioned:
> From Andy, Kevin :
>>
>> I felt the same way the first time I had a look at the website. All the rest of the options are extremely high-level (what java version, what technologies do you want to use, what app server).
>>
>> The beans.xml is a very low-level detail in comparison to the other items, and feels out of place.
>>
>> +1 for just giving the user the default
>
>
>> For somebody that is using the starter in the first place, the prompt for the beans.xml is overkill and confusing. Default it and skip the the prompt.
>
>
> Emily
> On Monday, March 11, 2019 at 12:54:55 PM UTC, Gavin King wrote:
>>
>> On Mon, Mar 11, 2019 at 1:42 PM 'Emily Jiang' via Eclipse MicroProfile
>> <microp...@googlegroups.com> wrote:
>>
>> > 1. keep beans.xml? Yes or No
>>
>> Yes. It's how CDI was intended to be used.
>>
>>
>>
>> --
>> Gavin King
>> Red Hat
>
> --
> You received this message because you are subscribed to the Google Groups "Eclipse MicroProfile" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to microprofile...@googlegroups.com.
> To post to this group, send email to microp...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/microprofile/c17a777b-b7eb-4645-ba35-04c8554e4457%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

John Clingan

unread,
Mar 11, 2019, 1:18:58 PM3/11/19
to MicroProfile


> On Mar 11, 2019, at 9:21 AM, Gavin King <gavin...@gmail.com> wrote:
>
> Oh perhaps I've misunderstood the question.
>
> If the option was:
>
>> 1. keep beans.xml as an explicit option in the generator
>
> Then I would say no. Just generate an empty one by default.

+1
> To view this discussion on the web visit https://groups.google.com/d/msgid/microprofile/CAP7PoCetUu4vnR1yRbddcYvvfxxxi0Sgn6arPVYPpF8snf2s4A%40mail.gmail.com.

Rhuan Henrique

unread,
Mar 11, 2019, 1:20:20 PM3/11/19
to MicroProfile

Emily Jiang

unread,
Mar 11, 2019, 5:35:28 PM3/11/19
to Eclipse MicroProfile
I am happy to go with an empty one, which is the same as option B, as far as functionality is concerned.

Thanks
Emily

Rudy De Busscher

unread,
Mar 12, 2019, 4:00:04 AM3/12/19
to Eclipse MicroProfile
I would not generate an empty one as people then needs to lookup the XML namespace in case they want to define something.

My preference is also to have the annotated scope as it more optimal (but developer needs to specify a scope and it requires the developer to think what is the best solution)

Rudy

Emily Jiang

unread,
Mar 13, 2019, 8:35:40 AM3/13/19
to Eclipse MicroProfile


On Tuesday, March 12, 2019 at 8:00:04 AM UTC, Rudy De Busscher wrote:
I would not generate an empty one as people then needs to lookup the XML namespace in case they want to define something.
Functionality wise, generating a beans.xml with bean-discovery-mode="all" is same as an empty one. However, including the xsd or version etc might be more readable or extensible. I am ok with either way.
 
My preference is also to have the annotated scope as it more optimal (but developer needs to specify a scope and it requires the developer to think what is the best solution)

I think this approach is suitable to someone who understands CDI. If someone who has not much knowledge of CDI, If she/he doesn't annotate the classes with bean-defining-annotation, Fault Tolerance, Metrics or other annotations will not be picked up. I think this is not user friendly. If we automatically generate a beans.xml with all classes opt-in by default, there is no issue. For experienced users, they can always change the discovery-mode to annotated if they want. There is no must to switch to annotation scenario, I don't think.

Emily

Gavin King

unread,
Mar 13, 2019, 9:19:23 AM3/13/19
to microp...@googlegroups.com

Ondro Mihályi

unread,
Mar 21, 2019, 4:07:50 AM3/21/19
to Eclipse MicroProfile
My vote

1) No - don't offer an option to generate beans.xml

2) Generate beans.xml with discovery "all" and add a comment that the file can be simply deleted to get "annotated" discovery

This is easy for newcomers, educates newcomers, also easy to switch to "annontated" or further configure.

Emily Jiang

unread,
Mar 21, 2019, 11:53:46 AM3/21/19
to Eclipse MicroProfile
Thank you Gavin, John, Ladislav, Rhuan, Rudy and Ondro for your vote and comments! Ondo, it might be odd to add the comment in the file. Maybe we can add a comment in the readme.

As most people vote for 2. Rudy has done the PR to reflect the feedback. The change will be online soon. This discussion is closed.

Thanks
Emily
Reply all
Reply to author
Forward
0 new messages