I am working on a project in which I try to avoid hard encodings of database identifiers in a .NET-oriented project. There are several cases when I need to set identifier values through code, but I don’t want to just hardcode the identifiers, as I did before, and this leads to database alignment nightmares, incremental identifiers were changed when the database was reset to the new system.
What I want to do is to create enumerable constants that store identifiers so that in the worst case only one file is updated if the database is ever changed instead of trying to go through thousands and thousands of lines of code to replace any identifier in the system.
This will work in one system, but in my company-oriented service environment, the transfers are not serialized with their values, but simply their names.
What is the best way to exchange identifiers through a web service? I would like to somehow use either enumerations (an ideal situation) or constants, but I cannot get this to work. I can create a web method that returns identifiers, but sending a web request for each identifier and then serializing the response and deserializing on the client machine just sounds like a bad idea.
EDIT
I did not quite understand what I was asking, so I’ll tell you in detail.
. , . , -. , , . , . , .
, , 1 enum/class . , .