Skip to content
Discussion options

You must be logged in to vote

Yes, that's correct.

The problem with ctor injection is that the object graph gets serialized/deserialized into different contexts - usually client and server - and so that model would require that you implement and register all the same services in both contexts. You'd be forced to have a DAL service on the client, for example.

Also, you'd need to register all your domain types (business and rule classes) as DI services, which seems like an onerous process.

Finally, there's a perf cost to using DI, and it would have a noticeable impact on loading large lists or other large object graphs. And on any deserialization of those graphs.

Given all that, I chose to support a service locator patt…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ajohnstone-ks
Comment options

Answer selected by ajohnstone-ks
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants