I am busy developing code that processes a bunch of objects that represent monthly reports for regions (e.g. one instance per region per month). Let's call them RegionMonthlyReport
objects. At the end of the month, a new set of RegionMonthlyReport
s need to be created for the next month that are populated with values from certain fields from the original RegionMonthlyReport
s.
In part of my code, these copies will be saved to the database, such that we have a time-phased full set of regions per month: say we had 10 regions, we'd have 10 records for a single month; after a full year of this, we'll have 10 regions x 12 months = 120 records.
My question is, where should I implement a method to make the 'copy' of the RegionMonthlyReport
object, and what are the pros/cons of a preferred approach? Should it be
- A method on the
RegionMonthlyReport
itself, likeRegionMonthlyReport.CreateCopy(newMonth)
- A static method in a utility class, like
StaticUtilityClass.CreateRegionMonthlyReportCopy(sourceRegionMonthlyReport, newMonth)
- Something else
Note that I'm not talking about any Copy
method in a framework. This is a solution design question. FWIW I'm developing in .NET/C#
This question seems to be somewhat relevant - and indicates that the second option might be better - but I'm too much of a beginner to confidently generalise to my case.