Relative Content

Tag Archive for object-oriented-design

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. This idea really works for simple getters and setters. But sometimes we usually come across methods that does more than one task internally , although it seems to be doing a single task if you look at a higher level of abstraction. An example of such a method can be :

How to design member access for an Article-type class? [duplicate]

This question already has answers here: Is it bad practice to use public fields? [duplicate] (3 answers) Closed 11 years ago. I am doing a final project in a C++ class writing a very simple usenet-like client/server. I figure that since it’s usenet-like I’ll have a NewsGroup class and an Article class, I’m now working […]

Log design approach

Logging was always a nightmare for me! Now I have to implement it again for a proxy system.
In this proxy application, some systems ask proxy system to call some other services.
What I have to log is

Derived Class Method Naming

I’m having a hard time coming up with a good naming convention for methods in derived classes that serve the same purpose as the methods in the base class. For example, if both the base class, and the derived class, need to initialize: