Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to re-factor
Message
 
 
To
14/02/2013 13:19:08
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01565967
Message ID:
01566045
Views:
51
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform