Skip to main content

Timeline for Creating HTTP proxies for services

Current License: CC BY-SA 3.0

20 events
when toggle format what by license comment
Mar 21, 2018 at 7:45 comment added t3chb0t @IanKemp haha I know :-) ... actually it needs to be removed because I don't even use it anymore... it's an artefact from a previous version.
S Mar 20, 2018 at 23:17 history suggested Ian Kemp CC BY-SA 3.0
added link to strategy pattern
Mar 20, 2018 at 23:08 review Suggested edits
S Mar 20, 2018 at 23:17
Mar 20, 2018 at 23:06 comment added Ian Kemp @t3chb0t I particularly like your ExitCode class. :p
Mar 20, 2018 at 20:55 comment added jpmc26 Let us continue this discussion in chat.
Mar 20, 2018 at 20:32 comment added t3chb0t @jpmc26 let me show you an example where I register several commands and other services in a container that then creates the entire application or another one also initializing the entire application from multiple modules nearly without any news. Now if I need a new dependency anywhere I just add it to the container, to the constructor(s) and it magically works ;-D e.g. ASP.NET-Core would be useless without DI.
Mar 20, 2018 at 20:24 comment added t3chb0t @jpmc26 no constructors... then how does you DI work? Via properties? Methods? Well, this does not look like you would be using any DI framework... no wonder you don't like it, I wouldn't either ;-]
Mar 20, 2018 at 20:19 comment added jpmc26 @t3chb0t It's a proprietary project. Also, the only reason we even have all these interfaces and objects is as a kludge around the fact you can't mock static methods. And on the contrary, the vast majority of our classes don't even have an explicit constructor. The NullReferenceExceptions show up later when actual queries are executed well after construction. And if just listing the types we need to construct using the DI's built in registration methods is the "wrong" way to do it, then it's too hard to get right. (Unsurprising, given the massive level of indirection it creates.)
Mar 20, 2018 at 20:18 comment added t3chb0t @jpmc26 now I'm pretty sure you use it incorrectly as I've never ever had any such problems with it. You probably do more then just initializing objects, like querying the database in constructors etc.
Mar 20, 2018 at 20:16 comment added t3chb0t @jpmc26 then I suppose you use it incorrectly because otherwise you'd love it. Do you happen to have this project on github?
Mar 20, 2018 at 20:13 comment added jpmc26 @t3chb0t No. I work every day in an app that uses it. It's nearly impossible to tell how anything is actually constructed. And the times that's actually been relevant, it's been a massive, massive headache. And yes, those times have happened, certainly more frequently than any of the problems DI is supposed to solve have. It also hides several constructor exceptions, resulting in extremely confusing NullReferenceExceptions when a database connection can't be established.
Mar 20, 2018 at 20:10 comment added t3chb0t @jpmc26 on the contrary, DI does wonderful things and tremendously simplifies virtually every application ;-]
Mar 20, 2018 at 20:01 comment added jpmc26 @t3chb0t Dependency injection does absolutely terrible things to the readability of your code base. It's way too much indirection.
Mar 20, 2018 at 16:37 comment added t3chb0t Since all base-addresses are known, you can register all http-clients as keyed serivces and inject this dictionary to the each IXService so that it gets its instance of http-client from there.
Mar 20, 2018 at 16:33 comment added Nkosi @t3chb0t how would you treat with the httpClient with the different base addresses? That could probably get its own factory as well I guess. Your thoughts?
Mar 20, 2018 at 16:30 comment added t3chb0t or simply use Autofac or any other DI framework :-)
Mar 20, 2018 at 14:42 history edited Nkosi CC BY-SA 3.0
added 974 characters in body
Mar 20, 2018 at 14:15 vote accept Alternatex
Mar 20, 2018 at 14:15 comment added Alternatex Nice! This is just about as elegant as I can make it.
Mar 20, 2018 at 13:44 history answered Nkosi CC BY-SA 3.0