I am very confused about SOLID violations because I have read different articles on different websites. So according to someone something is violated but then I read counter arguments. So I am very confused how to handle such things in exams???
For example the following code has SIP violated or not?
Code: Alles auswählen
class Person {
private IFormatter formatter;
public Person(IFormatter formatter){
this.formatter = formatter;
}
public string FirstName { get; set; }
public string LastName { get; set; }
public Gender Gender { get; set; }
public DateTime DateOfBirth { get; set; }
public string Format(Enum formatType) {
switch(formatType.Type) {
case formatType.JSON:
return formatter.json();
case formatType.FirstAndLastName:
return formatter.firstAndLastNameString();
default:
return SomeRuntimeException("Formatter Not Found");
}
}
}
I am just trying to understand these concepts because I'll use them my whole life

Thanking in anticipation
