3 ms·
Interfaces instead of subclassing is clear as an alternative and it has the benefit of allowing multiple inheritance. It's unclear what "function based" and "a
by BulgarianIdiot 5y ago
Interfaces instead of subclassing is clear as an alternative and it has the benefit of allowing multiple inheritance.
It's unclear what "function based" and "annotation based" would mean though.
If you mean passing closures that implement a specific contract, that's in effect "interface based" again. And annotations seem orthogonal in terms of use cases (also full disclosure, I find about 99% of annotation use to be poorly designed and leading to unnecessary static coupling).
- jayd16 5y agoThe first pattern in the article is function based. Annotations based is called "language integrated registration" in the article.