Walaa
Walaa wrote:
This means that if a user edits one of those tables, I want to regenerate the code in order to reflect that additional property.
Would the user get back to you to re-generate and build the code, every time he adds new values? Or do you plan on automating this?
Would you please explain why do you need to convert data into code (properties)..etc.
Yes, we are talking about data that is maintained by the dev team, and not regular users of the system. I could think of both manual regeneration or automating the process.
The reasons for this are quite a few, actually.
One thing is that this is because we are doing this today. I'm talking about a huge enterprise system that can't be down even for an hour. Based on that data, thousands of classes are being generated: Settings, enums, service clients etc. Basically, this part of the database is a huge repository of meta data.
We need to ensure a smooth transition, and this means that we will have to respect parts of our infrastructure, which is highly automated.
Another thing is overhead. This is a data driven system, and we are generating even UI code based on that data, which allows us to basically add some data to our database and trigger code-gen in order to create a whole UI/client/data tier. We don't want to lose that.
Furthermore, code-gen, e.g. of enum values is convenient and robust (we don't have to write the enums ourselves and map them to database values). It also ensures that the actual data and our code is in sync anyway. With hand-written enums that are mapped to your database, you could easily get them out of sync by adding/removing a row in the database. In our case, this would break the system which would automatically being detected through automated builds.
The same goes for a settings class. Given that I can just add a row with a key/value pair to the table and then automatically get a properly named and strongly typed property in a generated class, the prospect of writing that code by hand doesn't sound like a step into the right direction
Cheers,
Philipp