Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Do you need these to be separate classes, or can it be a single class that behaves differently depending on what values are provided during construction? Whenever I get deep enough into inheritance that I start worrying about the length of class names, I start to wonder if maybe inheritance might not be the proper tool for the job.
-
agox454y@EmberQuill it's a good general rule. In this case, the initial name is already long (ViewModelCollection) and actually yes, they are completely separated classes in the sense that they make the same things in different ways. This in turn seems the golden use case of inheritance, not parametrization.
I've a collection of ViewModels:
ViewModelCollection
but there is a specialized version for model based viewmodels:
ModelBasedViewModelCollection
and from this I derived a furtherly specialized version that handles deferred adds:
ModelBasedViewModelCollectionWithDeferredAdd.
Now this is ridicously long. How would you abbreviate this?
This is the kind of questions that, if posted on stackoverflow, cause you to be downvoted to death. Maybe here we can discuss a little bit without me being banned right away :-)
question
c# java