0

Is there a compelling reason to change a generic class name, as "inherited" from a Project Templete? I have this code in my new project, which was created from a (self-created) template:

// REPLACE: Change the name of this class, if desired, to something like "<formName>VisualWebPart"
public partial class VisualWebPart : UserControl

IOW, the comment is mine, but now I wonder: do I really need to change "VisualWebPart" to "DPlatypuswebPart" or so? It won't really make any difference if the Sharepoint site has multiple disparate pages with the same class name, will it? Or will it?

As to the argument for clarity ("which VisualWebPart?!?"), all the coder (me, probably) has to do is to cast his peepers up a few degrees to see the Solution name or the namespace, which are unique.

Note: My preference (if feasible) to just use the same class name in every project derived from the Project Template is for simplicity's sake: so I don't have to do a global search-and-replace, and possibly have some "invisible"/behind-the-scenes files that reference this name not get updated. IOW, I'm shaking in my coding booties that I may open a rat's nest or can of worms by getting too persnickety about names.

OTOH, I'm afraid that not changing the name could end up problematic. Which fear is (most) justified?

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 1
    Depends on the `namespaces`. If all your form classes are in the same `namespace`, then bad things will happen. – Der Kommissar Jun 05 '15 at 20:22
  • No, the namespace will always differ. It would be like: Namespace == Pterodactyl, className == VisualWebPart; Namespace == Cameleopard, className == VisualWebPart; Namespace == DuckbilledPlatypus, className == VisualWebPart – B. Clay Shannon-B. Crow Raven Jun 05 '15 at 21:46
  • 1
    Then *technically* nothing is wrong with that. Unless something specific to Sharepoint comes up, I can't think of any reason that would be problematic. – Der Kommissar Jun 05 '15 at 21:58

0 Answers0