I started writing a Person class for an end of year Project, I found a basic getset property from a previous project, but it has in a UML comment that the method currently has no protection.
Is this is simple as changing "public" to "Protected"? or am I missing something?
//PROPERTIES
/// <summary>
/// Property for "Title"
/// Read & Write property for attribute "Title"
/// set method currently has no protection
/// </summary>
///
public string Title
{
get { return title; }
set { title = value; }
}
public string FirstName
{
get { return firstname; }
set { firstname = value; }
}
public string MiddleName
{
get { return middlename; }
set { middlename = value; }
}
public string LastName
{
get { return lastname; }
set { lastname = value; }
}
PS. I'm in a basic OOP course, it's very simple code (My project only requires ONE property :P), I've never used validation within a get/set before, I'll look into it, but I think:
"protected set {title = value; }"
was exactly what I was looking for.