C
Charles Law
This is a sort of pattern question, but relating to how components are
coupled in a three-tier system.
I have a presentation layer, business layer and data access layer, the first
is the EXE, whilst the other two are implemented as DLLs. The EXE also
references a DLL that contains various user controls, one of which is based
on a grid control.
The coupling is currently like this:
Presentation.EXE -------- Controls.DLL
|
Business.DLL
|
Data.DLL
[I hope that shows up clearly enough]
When a row on a grid (in Controls.DLL) is clicked, an event is raised to
alert the presentation layer that a row has been selected, and to pass the
contents of that row; my RowClickedEventArgs object currently passes a
couple of strings.
I would like my RowClickedEventArgs to pass a Transaction (my invention)
object instead, so that if a blank row is clicked I can pass a null object
(Nothing). The problem is that the Transaction class is defined in the
Business Layer, because that is the class that is used to pass data between
the Presentation Layer and the Data Access Layer, and I don't think that the
Controls.DLL should be coupled to the Business Layer.
Can anyone offer a neat/correct solution to this? I imagine that this not an
uncommon scenario.
TIA.
Charles
coupled in a three-tier system.
I have a presentation layer, business layer and data access layer, the first
is the EXE, whilst the other two are implemented as DLLs. The EXE also
references a DLL that contains various user controls, one of which is based
on a grid control.
The coupling is currently like this:
Presentation.EXE -------- Controls.DLL
|
Business.DLL
|
Data.DLL
[I hope that shows up clearly enough]
When a row on a grid (in Controls.DLL) is clicked, an event is raised to
alert the presentation layer that a row has been selected, and to pass the
contents of that row; my RowClickedEventArgs object currently passes a
couple of strings.
I would like my RowClickedEventArgs to pass a Transaction (my invention)
object instead, so that if a blank row is clicked I can pass a null object
(Nothing). The problem is that the Transaction class is defined in the
Business Layer, because that is the class that is used to pass data between
the Presentation Layer and the Data Access Layer, and I don't think that the
Controls.DLL should be coupled to the Business Layer.
Can anyone offer a neat/correct solution to this? I imagine that this not an
uncommon scenario.
TIA.
Charles