Do delegates defy OOP

Posted by Dave Rook on Programmers See other posts from Programmers or by Dave Rook
Published on 2013-08-02T12:07:40Z Indexed on 2013/08/02 16:02 UTC
Read the original article Hit count: 273

Filed under:
|
|

I'm trying to understand OOP so I can write better OOP code and one thing which keeps coming up is this concept of a delegate (using .NET). I could have an object, which is totally self contained (encapsulated); it knows nothing of the outside world... but then I attach a delegate to it.

In my head, this is still quite well separated as the delegate only knows what to reference, but this by itself means it has to know about something else outside it's world! That a method exists within another class!

Have I got myself it total muddle here, or is this a grey area, or is this actually down to interpretation (and if so, sorry as that will be off topic I'm sure). My question is, do delegates defy/muddy the OOP pattern?

© Programmers or respective owner

Related posts about object-oriented

Related posts about .NET