Quick naming question for C # CMS
I am building a CMS and the naming convention for the classes was discussed between another developer and me. The problem arises with the "page", since it is a public class available in a typical library.
A natural answer would be to call it MVCMSPage (where MVCMS is the current cms name) or rely on a class reference via a dll (can't think of the term atm ..), but both seem to have a hint of code for them.
What would you suggest?
thank
source to share
I would go with something else besides Page
. The class Page
that is built into .NET is a very general class that is commonly known as part of ASP.NET. You can easily confuse other developers (or even yourself, months after the road, if you haven't looked at it for a while).
I usually use a naming convention like:
ApplicationName + "Page"
I also like to follow the MS.NET naming guidelines by only using the first letter of an abbreviation longer than 2 characters. Since ' MVCMS
' can be confusing for the MVC architecture style, if you are reading wrong, I would not use ' MvcmsPage
' or ' MvcmsPage
', I would call it something like this:
MvCmsPage
It is descriptive and fairly easy to read and understand.
Of course, it really depends on you. It's mostly a matter of preference. Just don't use ' Page
' as it will make some developers pissed off (like me).
source to share
I think the term you were looking for is namespace
.
I don't think I would rely on namespace differentiation for such a fundamental class in the System.Web space. If you are writing a console notification engine this might be fine, but since you are working in the web arena I would avoid it. My vote would be to use the namespace as the main differentiator and call it something simple, for example ContentPage
, so you have something like MvcCms.Web.ContentPage
the fully qualified class name.
If you do it this way, you can import both your namespace System.Web
and still be able to differentiate the classes. And you have a short name that makes sense and isn't cumbersome to use or refer to (speaking of it).
source to share
I think what you call "page" is the equivalent of a database writer application. As others say, this is a pretty loaded term. Here are some random ideas:
- Node
- View
- record page
- CmsPage
- web document
- ContentPage
Your choice should try to convey the essence of the object type. I would not put the product name in the class name. I prefer namespaces for this.
source to share