5
agox
3y

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 :-)

Comments
  • 3
    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.
  • 1
    View
    ViewCollection
    ModelViewCollection
    DeferredViewCollection
  • 2
    Stackoverflow.
  • 1
    @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.
  • 1
    @hack There is nothing as a 'View' here, but ViewModel
  • 2
    @Ranchonyx StackOverflowAsyncWriter
  • 1
    @agox decent comeback.
Add Comment