Skip to main content
21 events
when toggle format what by license comment
Jun 16, 2020 at 10:01 history edited CommunityBot
Commonmark migration
May 16, 2016 at 9:48 comment added RubberDuck @Jules I personally don't like it. Why should my widget know about IoC containers? If it adheres to some standard, my team would likely allow it though. (You'll have to excuse me. I'm a .Net guy. I've no idea what JSR-330 is. )
May 16, 2016 at 7:49 comment added Jules @RubberDuck - does your requirement not to use annotations for configuring DI extend to the standardised JSR-330 (javax.inject) annotations that are supported by most common frameworks and therefore wouldn't inhibit migration between them?
May 15, 2016 at 17:08 comment added candied_orange @RubberDuck now your point of view makes perfect sense. You avoid proprietary configuration by making your configuration dependant only on java itself.
May 15, 2016 at 17:06 comment added RubberDuck Not sure what you're getting at @CandiedOrange. It could be because I've never used XML to configure an IoC. I've always used code configuration.
May 15, 2016 at 16:55 comment added candied_orange @RubberDuck forbidding service locators just ensures it's really DI. Forbidding annotations, and attributes only ensures the existence of a robust configuration file (or your own pojo java factories that act as injectors). How do you ensure the configuration file isn't proprietary?These files can become quite large.
May 15, 2016 at 16:49 comment added RubberDuck @CandiedOrange my team would certainly send any code back that's using a Service Locator or annotations/attributes. It comes down to discipline. It's that discipline that makes the difference between amateurs and professions, I believe.
May 15, 2016 at 16:37 comment added candied_orange @RubberDuck most "composition roots" I've seen are about 5 lines of code in main. So no. not an overly difficult task. It's the proprietary stuff that escapes those lines that I'm warning against. You call it "doing DI properly". I'm asking if you what you'd use to prove a problem in a code review. Or would you just say "Meh"?
May 15, 2016 at 16:25 comment added RubberDuck @CandiedOrange I'm using "simple" as a relative term. In the grand scheme of things, replacing one composition root with another is not an overly difficult task. A few days work tops. As for ensuring you're doing DI properly, that's what Code Reviews are for.
May 15, 2016 at 14:30 history edited candied_orange CC BY-SA 3.0
added 14 characters in body
May 15, 2016 at 14:22 comment added candied_orange @RubberDuck correct. Short of testing and maintaining your code base constantly under multiple DI frameworks do you know a simple reliable way to check that "you're doing DI properly"? Even if I use nothing but pojo's in java, if significant effort has gone into making the XML it's still not a simple swap when the XML is dependant on the IoC container.
May 15, 2016 at 13:31 comment added RubberDuck Meh. If you're doing DI properly, it should be relatively simple to swap out one IoC Container framework for another. Keep those annotations out of your code and you'll be fine. Basically, use the IoC container to do DI instead of using the container as a service locator.
May 15, 2016 at 7:34 history edited candied_orange CC BY-SA 3.0
added 2 characters in body
May 15, 2016 at 7:08 comment added Laiv PowerMock has solved some of these cases. Atleast it let you mock up statics
May 15, 2016 at 3:41 history edited candied_orange CC BY-SA 3.0
deleted 23 characters in body
May 15, 2016 at 2:50 history edited candied_orange CC BY-SA 3.0
added 185 characters in body
May 15, 2016 at 1:23 history edited candied_orange CC BY-SA 3.0
added 133 characters in body
May 15, 2016 at 1:09 history edited candied_orange CC BY-SA 3.0
added 133 characters in body
May 15, 2016 at 1:01 history edited candied_orange CC BY-SA 3.0
added 133 characters in body
S May 15, 2016 at 0:52 history answered candied_orange CC BY-SA 3.0
S May 15, 2016 at 0:52 history made wiki Post Made Community Wiki by candied_orange