Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Dave, in your example, what is the difference, if any, between using a delegate vs making NotifyIfComplete internal/public and call Program.NotifyIfComplete directly, since NotifyIfComplete is a static method? Commented Feb 6, 2015 at 15:21
  • 1
    @PersyJack When you pass a delegate as a parameter then your method trusts that a suitable delegate is passed and your method has no understanding of the delegate's value/logic- it is decoupled. My Start method has no idea of anything other than what is passed to it. If I added a static method, then my Start method has to know about this static class and the method! I could also pass a delegate which actually doesn't pass NotifyIfComplete but passes my EmailCustomer or SaveToDatabase function. Commented Feb 6, 2015 at 15:39
  • Dave, thank you, I was just confused about the difference between passing a delegate vs calling a static method, but your explanation and this article made it clear. Commented Feb 6, 2015 at 15:43