Jump to content
  • Advertisement
Sign in to follow this  
derek7

object and ambiguity

This topic is 4497 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!