Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-1894

.NET: Delegate support in the API via extension methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.4
    • None
    • platforms

    Description

      In many places we require a single-method interface implementation from the user:

      ICompute
      TRes Call<TRes>(IComputeFunc<TRes> clo);
      

      All of these can be extended to accept a delegate:

      ICompute
      TRes Call<TRes>(Func<TRes> clo);
      

      We can't replace interfaces with delegates completely (which is desirable), because it will take away serialization control from the user. So the interface approach has to stay as a primary.
      Delegate support can be added via extension methods, which wrap provided delegates into a class that implements corresponding interface.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ptupitsyn Pavel Tupitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: