I am building a CMS and the naming convention for classes has been debated between the other developer involved and myself. The problem arises specifically with ‘Page’, as it is a public class available in a typical library.
A natural response would be to call it MVCMSPage (where MVCMS is the to-be name of the cms) or to rely on referencing the class through the dll (can’t think of the term atm..) but both seem to have a hint of codesmell to them.
What would you advise?
Thanks
I’d go with something other than ‘
Page‘. The ‘Page‘ class that is built into .NET is a very generic class that is commonly known as part of ASP.NET. You could easily confuse other developers (or even yourself, a few months down the road if you don’t look at it for a while).I usually go with a naming convention such as:
I also like to follow the MS .NET naming guidelines of only capitalizing the first letter of an acronym longer than 2 characters. Since ‘
MVCMS‘ can be confused for the ‘MVC’ architecture style if read incorrectly, I wouldn’t use ‘MvcmsPage‘ or ‘MVCmsPage‘, I’d call it something like this:This is descriptive and fairly easy to read and understand.
Of course it’s really up to you. Mainly it’s a matter of preference. Just don’t use ‘
Page‘ as it will make some developers angry (such as myself).