Multiple types of contacts I have a list of contacts, classified into categories. Each category is represented with a different class.

Base class:

class Contact
{
    public ushort Id { get; private set; }
    public Phone Phone { get; private set; }

    public Contact(ushort id, Phone phone)
    {
        Id = id;
        Phone = phone;
    }
}


And here are the categories:

PrivateServiceProvider (meaning - private person):

class PrivateServiceProvider : Contact
{
    public string FirstName { get; private set; }
    public string LastName { get; private set; }
    public ServiceField ServiceField { get; private set; }

    public PrivateServiceProvider(ushort id, string firstName, string lastName,
                                  ServiceField serviceField, Phone phone)
        : base(id, phone)
    {
        FirstName = firstName;
        LastName = lastName;
        ServiceField = serviceField;
    }
}


BusinessServiceProvider:

class BusinessServiceProvider : Contact
{
    public string Name { get; private set; }
    public ServiceField ServiceField { get; private set; }
    public Email Email { get; private set; }

    public BusinessServiceProvider(ushort id, string name,
                                   ServiceField serviceField, Phone phone, Email email)
        : base(id, phone)
    {
        Name = name;
        ServiceField = serviceField;
        Email = email;
    }
}


PrivateGenericContact:

class PrivateGenericContact : Contact
{
    public string FirstName { get; private set; }
    public string LastName { get; private set; }

    public PrivateGenericContact(ushort id, string firstName, string lastName, Phone phone)
        : base(id, phone)
    {
        FirstName = firstName;
        LastName = lastName;
    }
}


BusinessGenericContact:

class BusinessGenericContact : Contact
{
    public string Name { get; private set; }
    public Email Email { get; private set; }

    public BusinessServiceProvider(ushort id, string name, Phone phone, Email email)
        : base(id, phone)
    {
        Name = name;
        Email = email;
    }
}


It works, but how could I improve it1?

Also, it drives me CRAZY that the names of the classes are so lengthy. I think it's a smell but I am not sure what to do about it. If some day I decide to create another specification of Contact, let's say - for people who lives in the city versus in the country2, will I call the class CountryPrivateServiceProvider? It's NUTS.

An example of use is when the user creates a contact. So he chooses the type of contact and inserts all of the information into a form (a View - I am using MVP). Then the View notify the Presenter that the user pressed the "Save" and creates an object of the selected type. Then the Presenter ask the Model to insert the information into the database.

How can I improve my code, both generally and specifically to this naming problem?



1. They are deliberately immutable.

2. Apparently, I am not good with examples.
I find those classes should but just simple POCO classes with get/set properties. They could sit either inside a DTO or Model namespace or could have a Dto suffix and simple names like Person or PrivatePerson or BusinessPerson. They are not service providers as you call them.

However, you do want to differentiate between a PrivateCountry and a BusinessCountry. You could do this by adding the type of operation you need them for, like PrivateCountryForAddingDto or BusinessCountryForUpdatingDto. With this pattern you will have a few more models but the good thing is that each command will have its own independent model that can have its own validation logic. A model for adding does not necessarily have to have the same requirements as a model for updating. Some fields might be optional in one case and mandatory in another case.