I'm in development of a sample project in Android for a friend's phone that keeps track of his sales. At first, one of the requirements was to create yearly reports of this sales data. This would be stuff like most profitable week, total per quarter, total per month, and even yearly total, as well as compares for previous years (about 10 things total).
I created a class called YearlyReport that has all of these properties and they get populated from a database class that makes the appropriate SQL calls.
This data is displayed on a statistics page, but after seeing this my friend asked me to give the viewer the ability to select different weeks and display weekly data too (3 bits of information: the total for the week, the best day in the week, the worst day in the week). So as they change weeks in the year, he wants to see weekly data appear above the yearly data.
So now I need to do specific queries of weekly data, but display yearly data too. I feel really disorganized for some reason! At first I made a WeeklyReport object, and the database will say "ok for a given week W, I'll fill your WeeklyReport object and return it". Then I started wondering if I should do something smarter. Maybe combine something? Should there be inheritance? I'm missing something.
Is it OK to have a WeeklyReport and YearlyReport object? Should I combine them? If I do, it's still strange because the yearly report doesn't change much unless you move to a new year (not often), but the weekly does (depending upon the date).