About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Delegate Invocation

Another form of invocation is what I call indirect invocation. This is where delegates come in: Instead of knowing the precise target of an invocation, you know how the target looks in terms of the method signature. In essence, delegates are a way to pass methods around as objects. They form a kind of contract between two parties: a consumer and a provider. An example will clarify things, but we defer more thorough discussion until Chapter 17, “Delegates.”

Let’s consider a “modest” calculator as a trivial (and honestly, contrived) example. What the heck is a modest calculator? It’s one that knows about all commonsense arithmetic operations but also admits it can’t know everything. So, it enables the user of the calculator ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required