Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to re-factor
Message
 
 
À
14/02/2013 13:19:08
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01565967
Message ID:
01566045
Vues:
50
>>>Convention is properties start with UpperCaseLikeThis.
>>>
>>>What are the datatypes of the properties?
>>>
>>>>One more question - what is the common convention - have properties to start with upper case letter or lower case? E.g. should I use it exactly as
>>
>>Here is what I have now:
>>
>>
>>/// <summary>
>>        /// Class used to parse tcDetails into common properties (StartTime, EndTime, closeOperator, closeSalesPoint)
>>        /// </summary>
>>        private class DrawerDetails
>>        {
>>            public DateTime StartTime { get; private set; }
>>            public DateTime EndTime { get; private set; }
>>            public String CloseOperator { get; private set; }
>>            public String CloseSalespoint { get; private set; }
>>
>>            public void ParseDetails(String cDetails, String currentOperator, String currentSalespoint)
>>            {
>>                CloseOperator = cDetails.ParseStringFromSqml("CLOSE_OP");
>>                if (String.IsNullOrWhiteSpace(CloseOperator))
>>                    CloseOperator = currentOperator;
>>                CloseSalespoint = cDetails.ParseStringFromSqml("CLOSE_SP");
>>                if (String.IsNullOrWhiteSpace(CloseSalespoint))
>>                    CloseSalespoint = currentSalespoint;
>>
>>                StartTime = cDetails.ParseDateTimeFromSqml("START_TIME");
>>                EndTime = cDetails.ParseDateTimeFromSqml("END_TIME");
>>            }
>>
>>        }
>>
Thanks again, I re-factored that method and now I can code the method that has similar code with ease and re-use the class.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform