Rather than try to be funny, I'm just going to ship you off to Stack Overflow's entry on why base abstract generic classes are bad things (or not) and an article on immutability and inheritance. While not funny, you can sit in your cube by yourself pondering a "meaningful ancestor" until it starts to seem ridiculous.
It reminds me of the time, early in my C# career, when I used an interface, then based half a dozen classes of it in a provider model designed to eliminate all possibilities of recoding anything not specifically third party datasource related. If it could be put into the classes, even as an example for overriding later, I put it in there. By the time I was done, there were two dozen classes I had to extend, implement, or override to add a new provider/data source. It was beautiful in my head. The reality was I could just create a few methods and be running a new datasource. It was idiotic to anyone who had to deal with it and support my mess. Fortunately I flipped jobs before I could inflict it upon a junior developer.
Unrelated - this was my favorite tweet I came across today, where a friend referenced a Stack Overflow post about Why does parseInt(1/0, 19) return 18? Hint, think infinity and base 19.
Snarky: I've got it! public GenericBaseObject<T>:AbstractBaseGeneric<T>, IGenericObject. We can finally get rid of all those pesky "object" references in our code.
No comments:
Post a Comment