Is there a possibility or did anyone tried to generate an Apex helper class based off certain conditions runtime. I am thinking this just for LEARNING prospective. This will also reduce the number of components which we have to add in the quick deploy list.
Salesforce supports Tooling API however its not available to be used by Apex (Native).
But, Good news is "Andrew Fawcett" and "James Loghry" have created wrapper around this API so it can be easily used from Apex. You can find wrapper here and install directly to Salesforce.