我有一些像这样的代码: class DataFilter
{
List<Animal> animals=null;
public function1(string TypeOfData)
{
if(TypeOfData=="cat"){//get cats from database and do something}
else if(Typ
我在理解语句low in coupling and high in cohesion时遇到问题。我搜索了很多关于此的内容,但仍然觉得很难理解。 据我所知,High cohesion意味着,我们应该有专门用于执行特定功能的类。希望这是正确的?就像专门用于验证信用卡的信用卡验证类一样。 而且还不明白耦合是什么意思?