Nice article. Great explanation on each step one by one.
While this is useful to understand what is fluent interfaces, it would be really overkill if we do this for every class we are creating. To avoid that problem, there are already many libraries which provide this builder pattern on existing java objects for free. Example: Lombok.
With just one annotation @Builder on any class would implement this fluent interface by default.
I guess you might be already aware about this, but making a note of that in article would help the reader :)
Nice article. Great explanation on each step one by one.
While this is useful to understand what is fluent interfaces, it would be really overkill if we do this for every class we are creating. To avoid that problem, there are already many libraries which provide this builder pattern on existing java objects for free. Example: Lombok.
With just one annotation
@Builder
on any class would implement this fluent interface by default.I guess you might be already aware about this, but making a note of that in article would help the reader :)
Thanks for reading, Harshit!
This is a good point, but I think that annotations are a bit of an advanced concept -- they'd be a good topic for an article by themselves!