Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need a Script? Pin
Abubakarsb4-Mar-07 23:01
Abubakarsb4-Mar-07 23:01 
QuestionMoving a control along a line... [modified] Pin
new_phoenix4-Mar-07 8:51
new_phoenix4-Mar-07 8:51 
AnswerRe: Moving a control along a line... Pin
S. Senthil Kumar4-Mar-07 15:03
S. Senthil Kumar4-Mar-07 15:03 
Questionc# / COM / Excel Automation Add-Ins Pin
Member 38866844-Mar-07 7:07
Member 38866844-Mar-07 7:07 
QuestionStringConverter - Editing an existing value instead of creating one Pin
andy1804-Mar-07 5:18
andy1804-Mar-07 5:18 
AnswerRe: StringConverter - Editing an existing value instead of creating one Pin
Guffa4-Mar-07 10:00
Guffa4-Mar-07 10:00 
QuestionController/GUI in seperate asemblies Pin
MEK34-Mar-07 4:38
MEK34-Mar-07 4:38 
AnswerRe: Controller/GUI in seperate asemblies Pin
S. Senthil Kumar4-Mar-07 7:11
S. Senthil Kumar4-Mar-07 7:11 
Why would the Controller assembly have references to the GUI assembly? Typically, the GUI layer, being the upper layer, has a reference to the Controller layer and calls methods on the Controller layer in response to user actions. The GUI layer also subscribes to events from the Controller layer to update the UI. The Controller layer does not depend on a GUI layer being present and therefore doesn't have a reference to it.

Anyway, the typical way to break circular dependencies is to factor out the common functions into interfaces in a separate assembly and then make the other assemblies refer to the common assembly. Something like
// Assembly A - references B
class GUI : IGUI
{
   void DoGUI()
   {
   }

   void DoSomething(IController controller)
   {
     controller.DoFunc();
   }
}

//Assembly B
interface IController
{
   void DoFunc();
}

interface IGUI
{
  void DoGUI();
}

//Assembly C - references B
class Controller : IController
{
   void DoFunc(){}
   void DoSomething(IGUI gui)
   {
      gui.DoGUI();
   }
}

//Assembly D - references A, B, C
class Factory
{
   IController CreateController(){}
   IGUI CreateGUI(){}
}


Regards
Senthil [MVP - Visual C#]
_____________________________
My Blog | My Articles | My Flickr | WinMacro

QuestionIE Toolbar with visual studio 2005 Pin
ga2144-Mar-07 4:25
ga2144-Mar-07 4:25 
AnswerRe: IE Toolbar with visual studio 2005 Pin
Vasudevan Deepak Kumar4-Mar-07 5:04
Vasudevan Deepak Kumar4-Mar-07 5:04 
GeneralRe: IE Toolbar with visual studio 2005 Pin
Wayne Phipps4-Mar-07 6:25
Wayne Phipps4-Mar-07 6:25 
GeneralRe: IE Toolbar with visual studio 2005 Pin
Vasudevan Deepak Kumar4-Mar-07 15:33
Vasudevan Deepak Kumar4-Mar-07 15:33 
QuestionScanning through directories and subdirectories Pin
Polezniy4-Mar-07 1:01
Polezniy4-Mar-07 1:01 
AnswerRe: Scanning through directories and subdirectories Pin
kubben4-Mar-07 2:00
kubben4-Mar-07 2:00 
GeneralRe: Scanning through directories and subdirectories Pin
Polezniy4-Mar-07 9:50
Polezniy4-Mar-07 9:50 
GeneralRe: Scanning through directories and subdirectories Pin
Wayne Phipps4-Mar-07 10:26
Wayne Phipps4-Mar-07 10:26 
GeneralRe: Scanning through directories and subdirectories Pin
kubben4-Mar-07 11:11
kubben4-Mar-07 11:11 
GeneralRe: Scanning through directories and subdirectories Pin
Polezniy5-Mar-07 5:24
Polezniy5-Mar-07 5:24 
GeneralRe: Scanning through directories and subdirectories Pin
kubben5-Mar-07 5:29
kubben5-Mar-07 5:29 
AnswerRe: Scanning through directories and subdirectories Pin
Colin Angus Mackay4-Mar-07 4:20
Colin Angus Mackay4-Mar-07 4:20 
QuestionC# Denies simple math? :\ Pin
sharpiesharpie3-Mar-07 23:22
sharpiesharpie3-Mar-07 23:22 
AnswerRe: C# Denies simple math? :\ Pin
Christian Graus3-Mar-07 23:31
protectorChristian Graus3-Mar-07 23:31 
AnswerRe: C# Denies simple math? :\ Pin
Guffa4-Mar-07 1:44
Guffa4-Mar-07 1:44 
GeneralRe: C# Denies simple math? :\ Pin
Christian Graus4-Mar-07 2:14
protectorChristian Graus4-Mar-07 2:14 
AnswerRe: C# Denies simple math? :\ Pin
Guffa4-Mar-07 3:19
Guffa4-Mar-07 3:19 

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.