-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine services into a single service #615
Comments
Thoughts
|
We would probably need to sort this pre-GA/Beta, I'm guessing?
|
It depends on the proposed topology. Are we talking about nesting instances of each Service inside a single IE, My concern with not nesting is that I think we'll end up re-namespacing anyways. For example -- it seems likely we'd end up with say, And what would Overall I'm a +1 on this. Instantiating tons of different Services gets pretty messy. Definitely prefer a "want to use Trinsic? Make a |
Definitely. If we're going to do it, it needs to be done soon. It also needs to be a whole-team effort to get everything up to date. |
Yes, at least that is what @tmarkovski and I discussed. I think we could do this without too much trouble, and without really breaking anything. Having services namespaced is convenient, but completely isolating them seems to adds friction. We might even be able to get away with just extending and making public the base service, but I think it would also be possible to just create another I envision it working by creating a
If we are just implementing a wrapper I don't think we would need to, though it might be cleaner. |
I'd rather keep things the way they are, and layer on the channel management for the user. In general, I don't think people are trying to handle channel management themselves. I think just handling this automatically would be ideal from a customer perspective. Keep the existing services where they are, instantiate the base service (or something else), and it handles the account profile management and channel management for you? |
Base service approach doesn't solve the problem, as it still requires separate instances. Keeping everything in a single service allows us to add central management for the entire application. When a user is authenticated, we can set that globally for them, instead asking them so set it for every service in their DI collection. |
That's true. How would we want to handle base service instances wherein you have different The more I think about this, the more I think it's the right thing to do, but needs to be done right, and done now. If this delays the GA release, so be it. |
It'd be nice if we could have a For example, if you wanted to make a single call with a different auth token, but then switch back after, you'd have to do something like: trinsic.SetAuthToken(newToken);
trinsic.Wallet().InsertItem(...);
trinsic.SetAuthToken(originalToken); Whereas with the propose method, we could do: // Does not modify auth token of `trinsic`
trinsic.WithAuthToken(newToken).Wallet().InsertItem(...); It might take some cleverness (or hackery) to do this in a performant way where we aren't making tons of copies of the base services. The naive implementation of Alternatively, if the sub-service accessors will always be getter methods (eg |
I think we can all agree that developers won't be switching tokens a lot. This is a scenario we run into because we write tests and demos that showcase multiples personas. This is not a common use case otherwise. |
Some of the credential concerns might also be alleviated if we move to more of a "context" type system for storing user profiles. See #493 (comment) . This will also complicate things and for now really isn't necessary. Just throwing it out there FWIW. |
I know we're going to need this kind of complexity, so I'd rather support it sooner rather than later. |
Let's summarize this:
Anything else? |
I like this, it also reduces the chances of our classes poisoning theirs and requiring manual namespace resolution.
Definitely. The current
With the possible exception of go (@sethjback what say you?), yes it is. We can keep the existing protobuf services, and just expose the existing service classes as properties on the
👎 I dislike using prefixes to notate logical namespaces. We have the language constructs to properly scope, let's use them. Se my comment above.
Yes. This is the way. We provide a clear upgrade path without breaking our customers existing code. Eventually, we might change, but we can decide when to do that.
Let's get this done sooner rather than later. I say target 1.6 for this set of changes. |
Is this still a discussion point and/or something we plan to do? |
I'm personally a very big +1 on this. Call me a +2. Never before seen. The amount it would streamline our injected code samples alone makes it well worth it to me. Big win for clients, big win for us. |
Let's do it. :D |
@sethjback and I spoke briefly at IIW about not using separate services in the SDK, but use one single service. This simplifies a lot of the friction and complexity we have around setting different options, tokens, channels, etc. This only applies to the wrapper service, we can keep protobuf definitions separate. It also seems this change can be introduced seamlessly
Pros:
Cons:
Thoughts?
The text was updated successfully, but these errors were encountered: