Click here to Skip to main content
15,908,111 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I feel older now... Pin
PhilLenoir12-Feb-15 2:51
professionalPhilLenoir12-Feb-15 2:51 
JokeJOTD Pin
Abhinav S11-Feb-15 20:15
Abhinav S11-Feb-15 20:15 
GeneralRe: JOTD Pin
CDP180211-Feb-15 23:24
CDP180211-Feb-15 23:24 
GeneralRe: JOTD Pin
PIEBALDconsult12-Feb-15 4:01
mvePIEBALDconsult12-Feb-15 4:01 
GeneralAn important page in history ... PinPopular
Amarnath S11-Feb-15 18:32
professionalAmarnath S11-Feb-15 18:32 
GeneralRe: An important page in history ... PinPopular
DJ van Wyk11-Feb-15 19:57
professionalDJ van Wyk11-Feb-15 19:57 
GeneralRe: An important page in history ... Pin
Mark_Wallace11-Feb-15 23:22
Mark_Wallace11-Feb-15 23:22 
QuestionWhen to use dependency injection? Pin
Super Lloyd11-Feb-15 14:28
Super Lloyd11-Feb-15 14:28 
At work they are dependency injection crazy!
Most of the classes they write implement a unique equivalent interface. And whenever someone else need the code in that class they will have the interface injected and use it.

On the other hand I hate needless dependency injection and I write utility class which I just call directly when I need.

One of my new year resolution is to be a better ass kisser / networker though!

So... I am about to write a utility method which turn a file path into an HttpResponse.

Should I make it an IProvideHttpResponse service? or should it remain a simple utility method?
I kind of really struggle to see how far the stupid overuse of dependency injection should go.... Unsure | :~ Dead | X|

Mm... or maybe I should make an IUtility interface and put my mixed bag of utilities there?

what's your thoughts?

EDIT oh well, just for the sake of it, I implemented the IFileResponse service! Laugh | :laugh: Poke tongue | ;-P

EDIT2 I did just found this dependency injection gem in the code! Blush | :O
C#
public interface INowResolver
{
    DateTime Now { get; }
}

[Singleton]
public class NowResolver : INowResolver
{
    public DateTime Now
    {
        get { return DateTime.Now; }
    }
}

All in one Menu-Ribbon Bar
DirectX for WinRT/C# since 2013!
Taking over the world since 1371!


modified 11-Feb-15 20:44pm.

AnswerRe: When to use dependency injection? Pin
Gary R. Wheeler11-Feb-15 14:50
Gary R. Wheeler11-Feb-15 14:50 
JokeRe: When to use dependency injection? Pin
Super Lloyd11-Feb-15 14:57
Super Lloyd11-Feb-15 14:57 
AnswerRe: When to use dependency injection? Pin
Brisingr Aerowing11-Feb-15 15:00
professionalBrisingr Aerowing11-Feb-15 15:00 
AnswerRe: When to use dependency injection? Pin
al13n11-Feb-15 15:20
al13n11-Feb-15 15:20 
GeneralRe: When to use dependency injection? Pin
Super Lloyd11-Feb-15 15:59
Super Lloyd11-Feb-15 15:59 
GeneralRe: When to use dependency injection? Pin
Chad3F15-Feb-15 15:07
Chad3F15-Feb-15 15:07 
AnswerRe: When to use dependency injection? Pin
tgrt11-Feb-15 17:08
tgrt11-Feb-15 17:08 
GeneralRe: When to use dependency injection? Pin
Super Lloyd11-Feb-15 18:14
Super Lloyd11-Feb-15 18:14 
AnswerRe: When to use dependency injection? PinPopular
Erik Funkenbusch11-Feb-15 18:37
Erik Funkenbusch11-Feb-15 18:37 
GeneralRe: When to use dependency injection? Pin
Super Lloyd11-Feb-15 18:50
Super Lloyd11-Feb-15 18:50 
AnswerRe: When to use dependency injection? Pin
Dominic Burford11-Feb-15 21:14
professionalDominic Burford11-Feb-15 21:14 
GeneralRe: When to use dependency injection? Pin
Super Lloyd11-Feb-15 21:38
Super Lloyd11-Feb-15 21:38 
GeneralRe: When to use dependency injection? Pin
Dominic Burford11-Feb-15 23:09
professionalDominic Burford11-Feb-15 23:09 
GeneralRe: When to use dependency injection? Pin
jschell13-Feb-15 12:34
jschell13-Feb-15 12:34 
GeneralRe: When to use dependency injection? Pin
jschell13-Feb-15 12:29
jschell13-Feb-15 12:29 
AnswerRe: When to use dependency injection? Pin
Rob Philpott11-Feb-15 23:06
Rob Philpott11-Feb-15 23:06 
AnswerRe: When to use dependency injection? Pin
Mark_Wallace11-Feb-15 23:27
Mark_Wallace11-Feb-15 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.