This question will treat software like a tree, where: Each node in the tree represents some code unit (eg class \\ method \\ line etc.)
The mantra \"Keep high cohesion and low coupling\" (or some variant) is frequently tossed around.However, I find that it frequently conflicts with \"Don\'t repeat yourself.\"
Let\'s use as example: class AccountDAO { create(){..} read(){..} 开发者_运维问答update(){..} delete() {..}
I am given this set of code and need to suggest ways to improve the code\'s cohesion and coupling of the classes. But I thought these classes are quite well de-coupled since it looks like they are mak
I have persistent objects that are saved to the DB (insert, update, delete).开发者_开发问答 Is it better to combine this logic in a single method - Save or have 3 separate methods for cohesion?You sho
Assuming I have methods of doA(), doB() and doC() of classes A,B and C respectively. Than unless I am wrong, doA() method should belong to class A. It must be executed from Class A. If a method doA(
There are coupling and cohesion for modules. OK. There are functional and communication cohesion. Functional cohesion is grouping by functionality. OK. Communication cohesion is grouping by input/outp
I\'m writing a small piece of code in Python and am curious what other people think of this. I have a few classes, each with a few methods, and am trying to determine what is \"better\": to pass obje
I\'ve just read SRP, as easy as 123…, and all of it resonates with me except one paragraph, in a section named \"Cohesion\" (I\'ve claimed before to \"get\" Cohesion, but this talk of parameters vs i
I was reading Robert Martin\'s Clean Code and in that he mentions about the code being highly cohesive: