Yes, this is possible. See
https://github.com/jenkinsci/plot-plugin/blob/7e7504adc1f710a384af9961ea3940ab2ed11657/src/main/java/hudson/plugins/plot/PlotDescriptor.java
What can be seen frequently is that there is an abstract Descriptor 
implementation for extension points in a separate class, but the actual 
extensions have the descriptor as static inner class.
I think the reason why the descriptor implementation is usually a static inner 
class is because there is a tight relation between them. And quite often the 
descriptor contains few methods.

From: jenkinsci-dev@googlegroups.com <jenkinsci-dev@googlegroups.com> On Behalf 
Of tzach solomon
Sent: Mittwoch, 8. November 2023 20:43
To: jenkinsci-dev@googlegroups.com
Subject: Re: DescriptorImpl which is not public static inside the parent class

You don't often get email from 
tzach.solo...@gmail.com<mailto:tzach.solo...@gmail.com>. Learn why this is 
important<https://aka.ms/LearnAboutSenderIdentification>
>From my experience (and I understand it's only me), it is hard to maintain 
>multiple static classes over the years and I would like to make it as easy as 
>possible.
For example, in "io.jenkins.plugins.designlibrary.Select.java", there are 
multiple static classes and the class kind of loses the single responsibility 
principle.

So my question is it a must that the DescriptorImpl reside in the same class 
and as static?

Thanks in advance,
Tzach


On Tue, Nov 7, 2023 at 8:36 PM Basil Crow 
<m...@basilcrow.com<mailto:m...@basilcrow.com>> wrote:
On Tue, Nov 7, 2023 at 7:31 AM tzach....@gmail.com<mailto:tzach....@gmail.com>
<tzach.solo...@gmail.com<mailto:tzach.solo...@gmail.com>> wrote:
>
> can I create a class which will function as DescriptorImpl but not reside 
> inside the parent class as public static class?

What problem are you trying to solve that leads you to this question?

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-dev+unsubscr...@googlegroups.com<mailto:jenkinsci-dev%2bunsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAFwNDjqzroXLwof3PHfqiZeiKu1%3D5fyMK4bG49tSYqQkLZJ1vQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-dev+unsubscr...@googlegroups.com<mailto:jenkinsci-dev+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAC19wgK7g%3D%3D9epAt6GPspSxpD5o9ety6H6%2Bhf1h%2BB%3Dbc%2BoJF-g%40mail.gmail.com<https://groups.google.com/d/msgid/jenkinsci-dev/CAC19wgK7g%3D%3D9epAt6GPspSxpD5o9ety6H6%2Bhf1h%2BB%3Dbc%2BoJF-g%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/AS1PR02MB78470A0C0EEE5F569476863887A8A%40AS1PR02MB7847.eurprd02.prod.outlook.com.

Reply via email to