Glimpse / Glimpse.Prototype

Glimpse v2 prototype
MIT License
185 stars 42 forks source link

Split MessageHistoryResource #45

Closed nikmd23 closed 9 years ago

nikmd23 commented 9 years ago

MessageHistoryResource should be split into a basic history resource and a more advanced request-history resource.

The biggest architectural question about these resources will be figuring out how to let a resource opt-out if its dependencies aren't met.

Suggestions thus far are:

nikmd23 commented 9 years ago

In f48d5d8 I decided to go with the constructor approach (at least for now) for these reasons:

  1. We'll have to catch exceptions thrown by any extension code anyways, including constructors.
  2. If we went with the IOptOut approach, all calling code would have to follow this pattern:

    var e = new Extension();
    var o = e as IOptOut;
    if (o != null && o.OptOut == false)
    {
       // now safe to access members of e
    }
  3. The proposed IOptOut.Reason idea can still be leveraged, but will have to be pulled from Exception.Message instead.

The big question is, how do we want to expose these errors to users?

nikmd23 commented 9 years ago

This PR is good to be pulled in, but will break the client. I'm working on fixing the client now - and hopefully I can embed a fixed client into this PR, and merge it all in together.