Not a coding problem, but an architecture issue...
I develop on an enterprise-scale web application that mainly handles MySQL transactional data...create, edit, delete, view various records for work that goes on in our department.
To simplify things a bit, lets just say that there are 4 unique types of work being captured Report A, Report B, Report C, and Report D.
Each type of report shares a common set of properties, such as author, title, ref #, etc.
But each report also includes unique properties that are not shared among the other types.
This has all been handles procedurally before, in a single table.
I am now writing classes for this and replacing the single table with a parent table (for the common vars) and child tables for each report type.
So far so good, I have completed the parent class and the Report A child class. However, I've hit a snag.
For displaying records, etc, how am I going to know which child class to call for a given record?
I'd like to have a way that I could call one class, and have it decide which report type the current object belongs to, then call the correct child class (each child class extends the parent class already).