Extension methods

Brian Goetz brian.goetz at oracle.com
Sat Apr 27 11:41:33 UTC 2024



On 4/26/2024 10:40 AM, ІП-24 Олександр Ротань wrote:
>
> One thing I have to admit, is that they turned out much less usable 
> then it seemed to be for me. In fact, I found a major blind spot that 
> could be covered by their common design in most languages: they are 
> virtually incompatible with DI containers due to their static nature.

Indeed, the staticness of extension methods is part of what makes them 
problematic in many ways.  And you discovered in your exploration that 
in order to "fix" this, you have to bring in the complexity of another, 
different kind of override / lookup mechanism (not unlike implicits in 
Scala.)




More information about the amber-dev mailing list