Click here to Skip to main content
15,896,478 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Queue or how to syncronize without locking Pin
dotnetCarpenter21-Jul-08 5:56
dotnetCarpenter21-Jul-08 5:56 
QuestionThumbnail image or Control Pin
netJP12L17-Jul-08 9:52
netJP12L17-Jul-08 9:52 
AnswerRe: Thumbnail image or Control Pin
Pete O'Hanlon17-Jul-08 9:58
mvePete O'Hanlon17-Jul-08 9:58 
GeneralRe: Thumbnail image or Control Pin
netJP12L17-Jul-08 10:04
netJP12L17-Jul-08 10:04 
GeneralRe: Thumbnail image or Control Pin
Pete O'Hanlon17-Jul-08 10:06
mvePete O'Hanlon17-Jul-08 10:06 
QuestionA matter of coupling Pin
Leslie Sanford15-Jul-08 6:59
Leslie Sanford15-Jul-08 6:59 
AnswerRe: A matter of coupling Pin
Pete O'Hanlon15-Jul-08 9:37
mvePete O'Hanlon15-Jul-08 9:37 
GeneralRe: A matter of coupling Pin
Leslie Sanford15-Jul-08 11:28
Leslie Sanford15-Jul-08 11:28 
Pete O'Hanlon wrote:
I would definitely take a look into Dependency Injection


I did a search and found Martin Fowler's article on Dependency Injection.[^] Iteresting read.

My situation is similar but not exactly the same to that described in the article, but I think the principle is still applicable, more or less.

Basically, I have one class that offers a set of services, mainly simple notifications when certain things happen within the application. Next, I have a group of class's that use these services. Which services are used can vary from class to class.

The problem I run into is when I start trying to manually wire things up. So I've got my Service over here and my Clients over here, and I have to remember which services a client needs when wiring them together.

The solution that I've settled on is to pass the Service to each Client when it is created. Then the Client can subscribe to those services it needs. The containing class, the one containing all of the Clients, doesn't have to know how to hook up Clients to the Service; it just pass the Service along.

I think I like this solution. It has greater coupling in that Clients are familiar with the Service, but this can be mitigated by hiding the Service behind an interface, which I think is what Dependency Injection does, more or less.

Anyway, thanks for the reply. I'd heard of Dependency Inversion but not Dependency Injection.
GeneralEliminate coupling to concrete class assembly by (Dependency Injection) Spring.NET Pin
Fakher Halim17-Jul-08 6:38
Fakher Halim17-Jul-08 6:38 
GeneralRe: Eliminate coupling to concrete class assembly by (Dependency Injection) Spring.NET Pin
Pete O'Hanlon17-Jul-08 8:51
mvePete O'Hanlon17-Jul-08 8:51 
GeneralRe: Eliminate coupling to concrete class assembly by (Dependency Injection) Spring.NET [modified] Pin
Fakher Halim17-Jul-08 9:38
Fakher Halim17-Jul-08 9:38 
GeneralRe: Eliminate coupling to concrete class assembly by (Dependency Injection) Spring.NET Pin
Pete O'Hanlon17-Jul-08 9:57
mvePete O'Hanlon17-Jul-08 9:57 
GeneralRe: Eliminate coupling to concrete class assembly by (Dependency Injection) Spring.NET Pin
Fakher Halim17-Jul-08 10:01
Fakher Halim17-Jul-08 10:01 
GeneralRe: A matter of coupling Pin
led mike15-Jul-08 11:35
led mike15-Jul-08 11:35 
GeneralRe: A matter of coupling Pin
Pete O'Hanlon15-Jul-08 22:30
mvePete O'Hanlon15-Jul-08 22:30 
QuestionDesgin pattern... Pin
1.21 Gigawatts12-Jul-08 0:36
1.21 Gigawatts12-Jul-08 0:36 
AnswerRe: Desgin pattern... Pin
Luc Pattyn12-Jul-08 1:06
sitebuilderLuc Pattyn12-Jul-08 1:06 
GeneralRe: Desgin pattern... Pin
1.21 Gigawatts12-Jul-08 1:21
1.21 Gigawatts12-Jul-08 1:21 
GeneralRe: Desgin pattern... Pin
Pete O'Hanlon12-Jul-08 8:47
mvePete O'Hanlon12-Jul-08 8:47 
GeneralRe: Desgin pattern... Pin
Luc Pattyn12-Jul-08 9:02
sitebuilderLuc Pattyn12-Jul-08 9:02 
GeneralRe: Desgin pattern... Pin
Pete O'Hanlon12-Jul-08 9:32
mvePete O'Hanlon12-Jul-08 9:32 
GeneralRe: Desgin pattern... Pin
led mike14-Jul-08 5:46
led mike14-Jul-08 5:46 
GeneralRe: Desgin pattern... Pin
dojohansen22-Jul-08 22:34
dojohansen22-Jul-08 22:34 
GeneralRe: Desgin pattern... Pin
Pete O'Hanlon22-Jul-08 22:39
mvePete O'Hanlon22-Jul-08 22:39 
GeneralRe: Desgin pattern... Pin
led mike14-Jul-08 5:45
led mike14-Jul-08 5:45 

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.