• Advertisement
Sign in to follow this  

object and ambiguity

This topic is 4319 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

oo is: some object interact each other. but look at the class. class NoRealThingDoneByItself { userdefinedclass object1; userdefinedclass object2; userdefinedclass object3; ..... } it do nothing, it just call other class method. should it be treated as a empty class? what does the class wrap ? it just wrap some "message"?

Share this post


Link to post
Share on other sites
Advertisement
You might want to be a little bit more clear about your question. I don't understand what you're asking.

Share this post


Link to post
Share on other sites
The class you gave as an example looks like a simple struct.

If you mean a class which mostly calls it's embedded members functions inside it's own functions, you have a case of the Delegation Pattern. Delegation is a technique like Inheritance to distribute object behaviour.

Share this post


Link to post
Share on other sites
Quote:
Original post by Konfusius
The class you gave as an example looks like a simple struct.

If you mean a class which mostly calls it's embedded members functions inside it's own functions, you have a case of the Delegation Pattern. Delegation is a technique like Inheritance to distribute object behaviour.


Delegation Pattern I mean this. a class have no self function.it just call other function.

Share this post


Link to post
Share on other sites
another quesion:

I did not found Delegation Pattern in popular design book. but I found the pattern is good. so how many patterns do not still be mentioned at gangoffour?

Share this post


Link to post
Share on other sites
Quote:
Original post by derek7
I mean this. a class have no self function.it just call other function.


Well, a class without functions can't 'do' or 'call' anything, as it uses methods/member functions to do its work.

Share this post


Link to post
Share on other sites
Quote:
Original post by derek7
another quesion:

I did not found Delegation Pattern in popular design book. but I found the pattern is good. so how many patterns do not still be mentioned at gangoffour?


IIRC I learned about delegation from the GangOfFour book.
How to find other patterns: Google for "Portland Pattern Repository" first. Lots of stuff there, sometimes hidden in some corner of a wiki.
Some other search terms would be "design patterns" (obviously), "analysis patterns", "refactoring (catalogue)" etc. etc.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement