vendredi 17 février 2017

Why do some developers use a class for each property?

For Example:

class CustomerName
{
    public long Id { get; set; }
    public string Name { get; set; }
    public virtual Customers Customer { get; set; } 
}

class CustomerLastName
{
    public long Id { get; set; }
    public string LastName { get; set; }
    public virtual Customers Customer { get; set; } 
}

class CustomerBirtdate
{
    public long Id { get; set; }
    public DateTime Birthdate { get; set; }
    public virtual Customers Customer { get; set; } 
}

class Customer
{
    public long Id { get; set; }
    public CustomerName Name { get; set; }
    public CustomerLastName LastName { get; set; }
    public CustomerBirthdate Birthdate { get; set; }
}

Anyone know the advantage or disadvantage of doing this and what is the best way to be implemented?

Thanks so much..!

Aucun commentaire:

Enregistrer un commentaire