Click here to Skip to main content
15,887,428 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: All high-level classes must depend only on Interfaces Pin
PIEBALDconsult17-Feb-24 5:48
mvePIEBALDconsult17-Feb-24 5:48 
AnswerRe: All high-level classes must depend only on Interfaces Pin
englebart16-Feb-24 13:51
professionalenglebart16-Feb-24 13:51 
GeneralRe: All high-level classes must depend only on Interfaces Pin
raddevus17-Feb-24 4:36
mvaraddevus17-Feb-24 4:36 
GeneralRe: All high-level classes must depend only on Interfaces Pin
englebart17-Feb-24 14:20
professionalenglebart17-Feb-24 14:20 
GeneralRe: All high-level classes must depend only on Interfaces Pin
jschell19-Feb-24 6:01
jschell19-Feb-24 6:01 
JokeRe: All high-level classes must depend only on Interfaces Pin
englebart19-Feb-24 6:25
professionalenglebart19-Feb-24 6:25 
AnswerRe: All high-level classes must depend only on Interfaces Pin
RickZeeland16-Feb-24 20:10
mveRickZeeland16-Feb-24 20:10 
AnswerRe: All high-level classes must depend only on Interfaces Pin
Sander Rossel17-Feb-24 0:33
professionalSander Rossel17-Feb-24 0:33 
I'd balk at the word "All".
While I do use lots of interfaces, even for classes that rarely get a second implementation, I don't use an interface for everything.
It's simply impossible now to say all your future "high-level classes" (whatever that means) need an interface or need to be injected.

And if you use an interface, do it right.
I've seen software that used interfaces like this:
C#
public interface ISomething { ... }
public class Something : ISomething { ... }

// Scattered throughout the code:
ISomething something = new Something();

// But then also:
public Whatever DoSomeCalculations(Something something) { ... }
Their idea was that you could now easily write a Something2 and replace all new Something() with new Something2() if that was ever necessary.
If that's how you're going to "use" interfaces, you might as well not.

And then the occassional idiot saying everything needs an interface.

So with interfaces it's like with many things in life: it depends.

GeneralRe: All high-level classes must depend only on Interfaces Pin
raddevus17-Feb-24 4:41
mvaraddevus17-Feb-24 4:41 
AnswerRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani17-Feb-24 7:11
professionalRavi Bhavnani17-Feb-24 7:11 
GeneralRe: All high-level classes must depend only on Interfaces Pin
raddevus17-Feb-24 7:28
mvaraddevus17-Feb-24 7:28 
GeneralRe: All high-level classes must depend only on Interfaces Pin
englebart18-Feb-24 6:24
professionalenglebart18-Feb-24 6:24 
GeneralRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani18-Feb-24 6:57
professionalRavi Bhavnani18-Feb-24 6:57 
GeneralRe: All high-level classes must depend only on Interfaces Pin
englebart19-Feb-24 6:27
professionalenglebart19-Feb-24 6:27 
GeneralRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani19-Feb-24 9:16
professionalRavi Bhavnani19-Feb-24 9:16 
GeneralRe: All high-level classes must depend only on Interfaces Pin
hpcoder224-Feb-24 21:26
hpcoder224-Feb-24 21:26 
GeneralRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani24-Feb-24 21:48
professionalRavi Bhavnani24-Feb-24 21:48 
GeneralRe: All high-level classes must depend only on Interfaces Pin
hpcoder225-Feb-24 17:37
hpcoder225-Feb-24 17:37 
GeneralRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani25-Feb-24 20:05
professionalRavi Bhavnani25-Feb-24 20:05 
GeneralRe: All high-level classes must depend only on Interfaces Pin
hpcoder226-Feb-24 13:28
hpcoder226-Feb-24 13:28 
GeneralRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani27-Feb-24 4:51
professionalRavi Bhavnani27-Feb-24 4:51 
GeneralRe: All high-level classes must depend only on Interfaces Pin
hpcoder227-Feb-24 10:53
hpcoder227-Feb-24 10:53 
GeneralRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani27-Feb-24 12:24
professionalRavi Bhavnani27-Feb-24 12:24 
GeneralRe: All high-level classes must depend only on Interfaces Pin
jschell19-Feb-24 6:11
jschell19-Feb-24 6:11 
GeneralRe: All high-level classes must depend only on Interfaces Pin
Ravi Bhavnani19-Feb-24 9:14
professionalRavi Bhavnani19-Feb-24 9:14 

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.