Saturday, June 14, 2014

Will the real OOP please stand up?

Just because something is using a class doesn't mean it's doing OOP. This is not OOP:
public class Person
{
    public virtual int PersonId { get; set; }

    public virtual string LastName { get; set; }
    public virtual string FirstName { get; set; }

    public virtual int DreamCountryToTravelId { get; set; } 
}


This is OOP:
public class Person
{
    public virtual int PersonId { get; set; }

    public virtual string LastName { get; set; }
    public virtual string FirstName { get; set; }

    public virtual Country DreamCountryToTravel { get; set; }
}

No comments:

Post a Comment