Code Model Guidelines – Part 1

Using top quality Code Model is probably the most important thing to make the best out of the MyCodeFactory. Even if a model ‘Looks’ good, you must go through each and every line of code in it before proceeding for Code Generation. As a matter of fact you should subject the Code Model – regardless of whether it is downloaded or developed by you – to the same rigorous quality checks that you would do to any actual application before you deploy the application in production. As the Quality of Code Model is reflected in Generated Code, the efforts are really worth. It may seem very ordinary, non challenging work to a smart developer but it must be done and it must be done in correct way. A bit of irresponsibility or neglect would be magnified manifold in Generated Code.

Good Modeling
Code Model is all about generalization. The Base or Default Data Model is designed to cover most general scenarios and Code Model is expected to be in line with it. Code Model should NOT contain code that cannot be generalized.
For example, a real life application would need to restrict Age to certain range and have validations accordingly even at UX level. But do we need to do the same with Employee Age in Code Model ?
Nop.
Because Code related to Employee Age is representing how to handle numbers. Adding business related rules there would replicate that in Generated Code for all similar fields.

 

To summarize, the Code Model should only contain code that can be generalized and it must be developed as seriously as real life application.

 

Leave a comment

Your email address will not be published.