Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's the terminology?
Message
De
16/06/2010 11:02:25
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
16/06/2010 09:07:05
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01469189
Message ID:
01469237
Vues:
52
Hard coding something that could have potential for update or change is probably not the best way to do it. I would put something like that in a table so they can be updated. What if all of a sudden somebody needed a status of "Canceled" on those?

Enumerations are great for inside your code when you have code choices that are fixed. Like mmSaveDataResult.RulesPassed or mmSaveDataResult.RulesBroken. Those are enumerations you are already using. They are defined with the enum keyword.
public enum mmSaveDataResult
{
     RulesPassed,
     RulesBroken,
     etc
}
Tim

>>>Hi,
>>>
>>>my mind has gone blank this morning trying to remember the name of the coding structure that lets you define constants and let your code use them like a pick list.
>>>
>>>For example, I want to define a list like this:
>>>
>>>1 - Pending
>>>2 - In Force
>>>3 - Deferred
>>>4 - Matured
>>>and so on.
>>>
>>>Then when I refer to this structure while writing my code it is easy to see which number corresponds to which term.
>>>
>>>What I am looking for is an easy way to define the current status of an item and make it easy for this status to be translated to other languages. Is this the best way to achieve this?
>>
>>Enumerations.
>
>Thanks Mike!
>
>Do you think this is the best way to achieve this? Or can you suggest alternatives? Maybe I should just use a table with values so that they can be translated if needed?
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform