I have a (conceptually) fairly simple application spec that I'm implementing in PHP - the large part of it consists of loading project data, displaying it, allowing a user to edit it (potentially adding sections) and then sending said data back to the database.
I'm planning on approaching it thusly:
Have a set of basic 'Load' objects (E.g. ProjectLoad, FormLoad) that take an ID upon creation, query the database and fill themselves with the fetched data. These objects can then be used to fill the page elements.
Have another set of 'Save' objects (E.g. ProjectSave, FormSave) that take arrays (returned when the page is submitted), fill themselves with that data and then perform
INSERT\UPDATE
operations on the database.
Is this unnecessary duplication? I'm just getting a handle on OOPHP, and all of the advice I've seen so far seems to indicate that it is best to try and keep everything (objects, methods, etc) as focussed and single-purpose as possible. This seems to meet that criteria, but is there a better way?