"Responsibility" is so vague.

let' s consider the responsibility of a controller/manager class.

a controller/manager always never do real job, it just delegate

other objects to do jobs for itself. so what about the responsibility?

for example, A controller class named c1 delegates many jobs to a lot

of other object -- which all work fulltimely -- named : o1,o2,o3..... , so the

responsibility of c1 equals the sum of the responsibility of o1,o2,o3..?

In a extreme situtation , In a typical Adaptor pattern, can we say the "adaptor class" and "adaptee class" have the same responsibility?

for example:

class1:

{

void DoSomething();

}

class2: IInterface2

{

private Class1 class1;

void RunSomething()

{

class1.DoSomeThing();

}

}

does class2 has the same responsibility as class1?

thanks in advance!!!

[907 byte] By [LinMinha] at [2007-10-2 7:11:53]
# 1

No. One class invokes another's method. However, the signatures differ, so no delegation is occuring. Composition exists because class2 creates and is responsible for the scope of class1. Finally, a dependency exists where class2 requires class1. However, beyond that, not too much can be said.

- Saish

Saisha at 2007-7-16 20:45:19 > top of Java-index,Other Topics,Patterns & OO Design...