I have a point in my design where I seriously consider singleton.
As we all know, the “common” argument is “Never do it! It's awful!” As if we had tortured our code with a bunch goto.
ServiceStack is a great structure. My team and I are sold on it, and we have a complex infrastructure based on web services. I encourage asynchronous design and, where possible, with the help of a SendAsyncstack service on clients.
Given that we have all these different systems that do different things, it occurred to me that I would like to have a common registrar (the web service itself is actually, with a return to the local text file, if the web service is not available - for example, some demons are chasing a building). Although I am a big fan of Injection Dependency Injection, it seems to me not clean (at least to me) to pass a link to "use this client-registrar" to every asynchronous request.
Given that the ServiceStack failure signature is Func<TRESPONSE, Exception>(and I have no problem with that), I'm not even sure if the enable method that made the call in the first place would have a valid handle.
However, if at that moment we had a single logger, it does not matter where we are in the world, what stream we are in, and what part of the myriad of anonymous functions in which we are.
Is this a valid valid case, or is it not an argument - down with single dots?
source
share