views:

140

answers:

2

I have 2 main dlls.....one which has my user interface (windows form) and other which has the business logic.....I have a requirement in which the user interface has to be launched from the business logic with arguments......and on click of a button in the user interface, I need to send data from the user interface to the business logic.... I was wondering how I can achieve this without cross referencing the projects?..

+2  A: 

First of all, business logic BY DEFINITION should not launch a UI or have any UI components of its own.

Generally, to break cyclic dependencies like this, you need a third component.

Launcher -> UI -> Business Logic

Break apart the stuff that launches the UI into a separate module.

Eric J.
that was quick!....thanks!...I dont know why the third component idea didnt strike me.....I was using the business logic like a launcher...
A: 

The business logic should not be directly concerned with the UI. One way to do it might be to have another assembly that contains interface definitions which classes in your UI dll can implement. You can then handle an instance of your UI class to your business logic objects, which expects only the interface type.

Botz3000