Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Naming Convention for Class definition vs. Form

Tags:

.net

I have a lot developed in .NET windows forms and they are each named whatever they are with no prefixes. However, I often find myself needing to declare another class that contains the column names that the form uses.

For instance, I have a class called Address, which is a form for the maintenance of addresses. However, I also need a class that I'd like to also call Address that basically just contains the declarations of Name and Address fields. I am looking for a good naming convention to differentiate between the two (the class definition vs. the form).

like image 575
Jeff Stock Avatar asked Nov 28 '22 20:11

Jeff Stock


2 Answers

The normal convention for Windows Forms is to suffix the names of form classes with Form. So, your class for address should be called just Address (because, after all, it is an address), but the form that is used to edit addresses should be AddressForm (or AddressListForm, or AddressEditorForm, etc - depends on what exactly it does).

like image 53
Pavel Minaev Avatar answered Apr 01 '23 03:04

Pavel Minaev


Maybe this?

class Address { }
class AddressForm { }
like image 44
Andrew Hare Avatar answered Apr 01 '23 04:04

Andrew Hare