When you want to add some extra information into a class, what way would you prefer: would you extend that class or make a wrapper around it?
In my particular scenario, I want to add some pagination information with a List
that I get from database. That pagination information will include:
int currentPage;
int totalResults;
int containedResultsIndex;
int totalcontainedResults;
and a couple of methods:
Boolean isNextPageAvailable();
Boolean isPrevPageAvailable();
Whats your opinion, extend or wrap?