Re:Fluent: Static Extension Methods for Java
by rogerkeays on Monday July 03, 2023 @09:33AM
(#36572646)
How do you do the same thing to java.lang.String?
Re:Fluent: Static Extension Methods for Java
by ivan_gammel on Monday July 03, 2023 @09:55AM
(#36572923)
A class MyStringBuilder with domain-specific fluent interface can do the job perfectly.
Re:Fluent: Static Extension Methods for Java
by rogerkeays on Monday July 03, 2023 @10:34AM
(#36573473)
and a MyStringBuilderInterfaceProxyFactory too of course
Re:Fluent: Static Extension Methods for Java
by ivan_gammel on Monday July 03, 2023 @10:48AM
(#36573687)
Hate towards design patterns is a typical sign of not understanding them. Having a builder class to construct a certain subset of generic objects is a normal design practice, so your irony does not look appropriate and does not contribute to the discussion.
Re:Fluent: Static Extension Methods for Java
by rogerkeays on Monday July 03, 2023 @11:58AM
(#36574789)
OK, sorry.
As to whether they're worth the addition trouble or not, I sure as heck don't know.
But it's definitely nothing out of the ordinary.
There are variations, for example where only the last call actually creates, say, a Blob array and where every intermediate call produces something only allowing the next method to be called, so that the IDE autocompletes nearly everything for you and where you won't be able to compile if you miss a single call.Don't know if the following link is any good but "fluent interfaces" are 15 years old stuff at least by now I'd say:
https://java-design-patterns.com/patterns/fluentinterface/#e...