I am recently working on a class that represents a table:
public class Table
{
public StudentsOfTableList StudentsOfTable;
public Point PositionUpperLeftCorner;
public Size TableSize;
public readonly Guid TableID;
public Table()
...
public static bool AreIdentical(Table table1,Table table2)
...
public static bool Table1InFrontOfTable2(Table table1, Table table2)
...
}
As you can see here, this class is actually a data structure. I have some code later that compares the TableIDs to see if two tables are identical, and I really want to refactor the code so that there is a method in the Table class that determines if two tables are identical. However, as Clean Code the book says, a class with public fields and behaviors are hybrids, and those hybrids are bad code. Because of that, I didn't add a instance method to the class that checks if the tables are identical, rather I added a static method that compares two tables. Will this static method turn the class into a hybrid?