Re: [EMAIL] Fluent interface
At some point in the future we will have a 2.0 and that's when to revist this issue. Feel free to create a Jira ticket to request this as a feature for a future 2.0. Gary On Fri, Sep 29, 2023, 7:47 AM Elliotte Rusty Harold wrote: > Personal opinion: it probably wasn't intentional, but please don't do > that. It doesn't help anyone and is needless churn. Fluent methods are > not better than non-fluent ones, and are in fact less semantic and > harder to debug. They prioritize saving code writing over code > maintainability. > > Not just personal opinion: The API MUST not be changed in an > incompatible way. Changing the return type of an overridable method is > an incompatible change that is forbidden. Return types of > non-overridable methods (final, private, or static) might be able to > be changed, but still shouldn;t be. > > On Fri, Sep 29, 2023 at 7:13 AM Filip Strajnar > wrote: > > > > Greetings, > > > > > > I've noticed that some methods on the org.apache.commons.mail.Email > > class provide fluent interface (examples include setCc, addBcc, > > addReplyTo), and some do not (to name a few: setAuthentication, > > setSmtpPort, setMailSession). Is this intentional, or am I allowed to > > submit a PR that would change all relevant void methods so that they > > would return an Email object instead? > > > > > > Sincerely, > > > > Filip Strajnar > > > > > > - > > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > > For additional commands, e-mail: dev-h...@commons.apache.org > > > > > -- > Elliotte Rusty Harold > elh...@ibiblio.org > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [EMAIL] Fluent interface
Personal opinion: it probably wasn't intentional, but please don't do that. It doesn't help anyone and is needless churn. Fluent methods are not better than non-fluent ones, and are in fact less semantic and harder to debug. They prioritize saving code writing over code maintainability. Not just personal opinion: The API MUST not be changed in an incompatible way. Changing the return type of an overridable method is an incompatible change that is forbidden. Return types of non-overridable methods (final, private, or static) might be able to be changed, but still shouldn;t be. On Fri, Sep 29, 2023 at 7:13 AM Filip Strajnar wrote: > > Greetings, > > > I've noticed that some methods on the org.apache.commons.mail.Email > class provide fluent interface (examples include setCc, addBcc, > addReplyTo), and some do not (to name a few: setAuthentication, > setSmtpPort, setMailSession). Is this intentional, or am I allowed to > submit a PR that would change all relevant void methods so that they > would return an Email object instead? > > > Sincerely, > > Filip Strajnar > > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > -- Elliotte Rusty Harold elh...@ibiblio.org - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
Re: [EMAIL] Fluent interface
I think the natural next question is whether we can have a major version change? Mike On Fri, Sep 29, 2023 at 6:24 AM sebb wrote: > On Fri, 29 Sept 2023 at 12:13, Filip Strajnar > wrote: > > > > Greetings, > > > > > > I've noticed that some methods on the org.apache.commons.mail.Email > > class provide fluent interface (examples include setCc, addBcc, > > addReplyTo), and some do not (to name a few: setAuthentication, > > setSmtpPort, setMailSession). Is this intentional, or am I allowed to > > submit a PR that would change all relevant void methods so that they > > would return an Email object instead? > > The return type is part of the Java method signature. > > Changing it would affect binary compatibility, so would not be > possible without a major version change. > > > > > Sincerely, > > > > Filip Strajnar > > > > > > - > > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > > For additional commands, e-mail: dev-h...@commons.apache.org > > > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >
Re: [EMAIL] Fluent interface
On Fri, 29 Sept 2023 at 12:13, Filip Strajnar wrote: > > Greetings, > > > I've noticed that some methods on the org.apache.commons.mail.Email > class provide fluent interface (examples include setCc, addBcc, > addReplyTo), and some do not (to name a few: setAuthentication, > setSmtpPort, setMailSession). Is this intentional, or am I allowed to > submit a PR that would change all relevant void methods so that they > would return an Email object instead? The return type is part of the Java method signature. Changing it would affect binary compatibility, so would not be possible without a major version change. > > Sincerely, > > Filip Strajnar > > > - > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org