3
votes
3answers
306 views

Making some methods mostly contain method calls, while others doing “the lowest level” work [duplicate]

So I thought about this, and I don't know if it's included or not in any methodology. I think the advantages of this coding style is that, at the lowest level, the code is extremely testable, and ...
2
votes
5answers
522 views

Why sequential cohesion for operations in a method is not a good idea?

I read from the seminal Code Complete book that method statements that require to be executed in order passing parameter from one to the next is a code smell and is an example of a sequential ...
2
votes
1answer
297 views

Understanding high cohesion principle for methods in object oriented design

I know the idea of strong cohesion applies to methods as much it applies to classes. Just to be clear when I say strong cohesion of a method I mean a method which does only one task and does it well. ...
10
votes
2answers
700 views

Design: Object method vs separate class's method which takes Object as parameter?

For example, is it better to do: Pdf pdf = new Pdf(); pdf.Print(); or: Pdf pdf = new Pdf(); PdfPrinter printer = new PdfPrinter(); printer.Print(pdf); Another example: Country m = new ...