Hi there,
I am currently working on a little application: The structure follows in some way the MVC pattern. For short it has the basic things, Models, Controllers etc.
Now I am sitting here and do not know whether :
1.
The SQL database is only managed by a model through methods the programmer gives him like: "Hey we have name
record so we need a getName()
method".
OR
2.
The model dynamically creates the whole database and methods, using a XML file, with which even a non-programmer can design a database.
And should the model class check every/a single request whether it is a valid request e.g. getName()
won't work on the houses_tbl
, and if it is not valid it does not perform the query, and sends back an error message instead?
I have absolutely no idea how to handle my model class, which structure it should follow and how much the programmer should have to put into a new model so it works as he wants it to work.
Major points:
- perfomance (which way saves the most perfomance)
- KISS (which way is simple enough, so a second team mate can understand my logic)
- extendability (can I extend the structure)