Access scoping is an alternative technique to method chaining. Access scoping achieves some of the same benefits as method chaining, and also provides a bit functionality that method chaining does not provide.
This video shows how to implement access scoping easily in your own code - and how to use access scoping even with classes that were not designed for neither method chaining nor access scoping.
Access scoping is similar to, but not the same as, the "with" operation in some languages.
Access scoping is also similar to Kotlin's scope functions - but Java does not yet have those, as far as I know (but I could be wrong) .
Hopefully we can one day get access scoping built directly into our programming languages. This video has a suggestion for how that could look too.
X (Twitter): @jjenkov
LinkedIn: / jakob-jenkov-4a3a8
Method Chaining - video:
• Method Chaining - Express More With Less Code
Java - video playlist:
• Java Language