What should be done with class names that conflict (common) framework names

Posted by Earlz on Programmers See other posts from Programmers or by Earlz
Published on 2012-10-22T04:51:56Z Indexed on 2012/10/22 5:15 UTC
Read the original article Hit count: 508

Filed under:
|
|
|

What should be done exactly when the most obvious class name for a component is taken by a framework? In my case, I need to make a class that describes an HTTP request. Of course, the most common name is "taken" as System.Web.HttpRequest. What should I do? This project will be used in a web context, so I'd really rather not force people to not import the System.Web namespace, or type out all of my class names manually.

What is the usual way of dealing with this? I can come up with this:

  • Prefix class name with a project shortname
  • Try to come up with a different name that means the same thing(I've tried and can't come up with anything)
  • Force users to choose between namespaces

© Programmers or respective owner

Related posts about c#

Related posts about .NET