I have an app with many tables and a class that handles the basic (add,edit,delete,update) functionality required to interact with each table. - Several different, very simple classes, one class per table.
Say a page has 50 'entries' - each requiring some data from each table.
Is it best to keep the classes as they are: Light and simple, keeping the 'baggage' the app carries from page to page light.
Or, extend the classes to carry much more sophisticated functionality.
The first means many, many calls to the DB for one page with 50 entries. But, much less 'baggage' being carried from page to page throughout the site. (size of require()'d classes/scripts)
The second, more baggage but more complicated calls to the DB meaning much less calls to the DB per page and more efficient queries.
Which is the lesser of the 2 evils and why?
I'd go with the second but, what about the huge amount of code being carried from page to page?
Look forward to your thoughts...