开发者

What are Delegates? [duplicate]

This question already has answers here: How does a delegate work in objective-C? (5 answers) Closed 7 years ago.

I have several documents and the videos on Stanford that explain开发者_如何转开发 it, but I still fail to get my head around what Delegation actually is.

I'm trying to picture them in a real use so I can relate to it.

Are the similar to event hooks? I've used event hooks in some PHP frameworks.

Sometimes I need things explaining in lamans terms before I can go "ah ha, I get it".

Thanks.


In software engineering, the delegation pattern is a design pattern in object-oriented programming where an object, instead of performing one of its stated tasks, delegates that task to an associated helper object.

Read this wikipedia article in detail.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜