3 ms·
This puts into words why I hate subclass based frameworks and get footgunned by some convention-over-configuration frameworks. My preference would be function
by SinParadise 5y ago
This puts into words why I hate subclass based frameworks and get footgunned by some convention-over-configuration frameworks.
My preference would be function based, interface based and annotation based, in that order.
- BulgarianIdiot 5y agoInterfaces 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.