473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Decoupling

Hi.
I'm working on an application with a Data Access Layer, API and UI.
There are some entity classes defined in the DAL which the UI uses through
the API.
This means that there is some coupling between the DAL and the UI.
Is it possible or advisable to separate the DAL completely from the UI?
How can i achieve this?
Thanks,
Sharon.

Oct 28 '06 #1
7 3062
Hello Sharon,

This doesn't completly mean that your UI/DAL is coupled. They are coupled
if they can't be divided and strictly depends on each other - for example
u use some internal DAL structures.
But if your entity traversing between layers as the published well-know entity
it's not coupling.
SI'm working on an application with a Data Access Layer, API and UI.
SThere are some entity classes defined in the DAL which the UI uses
Sthrough
Sthe API.
SThis means that there is some coupling between the DAL and the UI.
SIs it possible or advisable to separate the DAL completely from the
SUI?
SHow can i achieve this?
SThanks,
SSharon.
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 28 '06 #2
I'd say that it's better practice to remove any dependecies between
your UI and DAL components. You could add some code to your API
(business layer) that in turn calls your DAL layer, then return the
data back to the UI from the API in whatever format is required.

Sharon wrote:
Hi.
I'm working on an application with a Data Access Layer, API and UI.
There are some entity classes defined in the DAL which the UI uses through
the API.
This means that there is some coupling between the DAL and the UI.
Is it possible or advisable to separate the DAL completely from the UI?
How can i achieve this?
Thanks,
Sharon.
Oct 28 '06 #3
Hi Sharon,

The three-layered architecture that you are using, when coded properly, allows
you to swap out one GUI with another, or change the location of your database,
or even its design, or add/modify/remove existing business rules in the API,
all independently of one another.

Your goal should be to optimize the coupling between dependant objects in
adjacent layers and ensure that you use flexible enough design patterns to
meet the needs of your application, which may help to make change control
easier as well.

If you feel that the current architecture isn't flexible enough, and can state
specific reasons why, then I'd recommend looking into other patterns to use in
conjunction with the layered approach that you have in place already.

An example of one such pattern is the ASP.NET 2.0 provider pattern (which
works quite well in WinForms apps too). This pattern provides a flexible,
pluggable architecture that you can use in your own object models to extend or
modify the ability of your application at a later time. If you feel that you
might need to modify API logic, or switch data storage contexts in the future,
or quite often now, then the provider pattern might be of use to you. The
abstract factory pattern in addition to the provider pattern provides an
extremely flexible framework for your object models. It's also highly
configurable through the web.config or [app].config files, with FCL support
for the base functionality of the provider infrastructure and simple
configuration handling.

Here's a list of some basic design patterns that you might find useful:

ASP.NET Provider Toolkit on MSDN:
http://msdn2.microsoft.com/en-us/asp.net/aa336558.aspx

Gang of Four (GOF) Patterns:
http://www.dofactory.com/Patterns/Patterns.aspx

There are many other references out there - just do some searching :)

--
Dave Sexton

"Sharon" <no*****@null.voidwrote in message
news:e0****************@TK2MSFTNGP04.phx.gbl...
Hi.
I'm working on an application with a Data Access Layer, API and UI.
There are some entity classes defined in the DAL which the UI uses through
the API.
This means that there is some coupling between the DAL and the UI.
Is it possible or advisable to separate the DAL completely from the UI?
How can i achieve this?
Thanks,
Sharon.

Oct 28 '06 #4
Hi Michael.
The entity classes are defined in the DAL.
This means that for the UI to compile, the UI project needs reference to the
DAL project.
What do you mean by "traversing between layers" and "published well-know
entity"?
Thanks.

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:17***************************@msnews.microsof t.com...
Hello Sharon,

This doesn't completly mean that your UI/DAL is coupled. They are coupled
if they can't be divided and strictly depends on each other - for example
u use some internal DAL structures.
But if your entity traversing between layers as the published well-know
entity it's not coupling.
SI'm working on an application with a Data Access Layer, API and UI.
SThere are some entity classes defined in the DAL which the UI uses
Sthrough
Sthe API.
SThis means that there is some coupling between the DAL and the UI.
SIs it possible or advisable to separate the DAL completely from the
SUI?
SHow can i achieve this?
SThanks,
SSharon.
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche


Oct 28 '06 #5
Hello Sharon,

Entity shouldn't be tied up with specific layer, it's just entity that represent
a part of your data
Create separate namespaces that will keep your entities and your UI and DAL
should correspont to interfaces of your entities (if only u select them not
using more general appoach with DataTables).

When u need to get specific data u just ask your DAL (more better ask BAL
about info and it ask DAL for his turn) and he returns you your data

SHi Michael.
SThe entity classes are defined in the DAL.
SThis means that for the UI to compile, the UI project needs reference
Sto the
SDAL project.
SWhat do you mean by "traversing between layers" and "published
Swell-know
Sentity"?
SThanks.
S"Michael Nemtsev" <ne*****@msn.comwrote in message
Snews:17***************************@msnews.microso ft.com...
S>
>Hello Sharon,

This doesn't completly mean that your UI/DAL is coupled. They are
coupled
if they can't be divided and strictly depends on each other - for
example
u use some internal DAL structures.
But if your entity traversing between layers as the published
well-know
entity it's not coupling.
SI'm working on an application with a Data Access Layer, API and
UI.
SThere are some entity classes defined in the DAL which the UI uses
Sthrough
Sthe API.
SThis means that there is some coupling between the DAL and the UI.
SIs it possible or advisable to separate the DAL completely from
the
SUI?
SHow can i achieve this?
SThanks,
SSharon.
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 28 '06 #6
Got it.
This way the application is also remoting ready.
Thanks.

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:17***************************@msnews.microsof t.com...
Hello Sharon,

Entity shouldn't be tied up with specific layer, it's just entity that
represent a part of your data
Create separate namespaces that will keep your entities and your UI and
DAL should correspont to interfaces of your entities (if only u select
them not using more general appoach with DataTables).

When u need to get specific data u just ask your DAL (more better ask BAL
about info and it ask DAL for his turn) and he returns you your data

SHi Michael.
SThe entity classes are defined in the DAL.
SThis means that for the UI to compile, the UI project needs reference
Sto the
SDAL project.
SWhat do you mean by "traversing between layers" and "published
Swell-know
Sentity"?
SThanks.
S"Michael Nemtsev" <ne*****@msn.comwrote in message
Snews:17***************************@msnews.microso ft.com...
S>
>>Hello Sharon,

This doesn't completly mean that your UI/DAL is coupled. They are
coupled
if they can't be divided and strictly depends on each other - for
example
u use some internal DAL structures.
But if your entity traversing between layers as the published
well-know
entity it's not coupling.
SI'm working on an application with a Data Access Layer, API and
UI.
SThere are some entity classes defined in the DAL which the UI uses
Sthrough
Sthe API.
SThis means that there is some coupling between the DAL and the UI.
SIs it possible or advisable to separate the DAL completely from
the
SUI?
SHow can i achieve this?
SThanks,
SSharon.
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche


Oct 28 '06 #7
Thanks Dave.
I'm familiar with the factory pattern.
I'll learn the provider pattern and see how i can use it.
Sharon.

"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
Hi Sharon,

The three-layered architecture that you are using, when coded properly,
allows you to swap out one GUI with another, or change the location of
your database, or even its design, or add/modify/remove existing business
rules in the API, all independently of one another.

Your goal should be to optimize the coupling between dependant objects in
adjacent layers and ensure that you use flexible enough design patterns to
meet the needs of your application, which may help to make change control
easier as well.

If you feel that the current architecture isn't flexible enough, and can
state specific reasons why, then I'd recommend looking into other patterns
to use in conjunction with the layered approach that you have in place
already.

An example of one such pattern is the ASP.NET 2.0 provider pattern (which
works quite well in WinForms apps too). This pattern provides a flexible,
pluggable architecture that you can use in your own object models to
extend or modify the ability of your application at a later time. If you
feel that you might need to modify API logic, or switch data storage
contexts in the future, or quite often now, then the provider pattern
might be of use to you. The abstract factory pattern in addition to the
provider pattern provides an extremely flexible framework for your object
models. It's also highly configurable through the web.config or
[app].config files, with FCL support for the base functionality of the
provider infrastructure and simple configuration handling.

Here's a list of some basic design patterns that you might find useful:

ASP.NET Provider Toolkit on MSDN:
http://msdn2.microsoft.com/en-us/asp.net/aa336558.aspx

Gang of Four (GOF) Patterns:
http://www.dofactory.com/Patterns/Patterns.aspx

There are many other references out there - just do some searching :)

--
Dave Sexton

"Sharon" <no*****@null.voidwrote in message
news:e0****************@TK2MSFTNGP04.phx.gbl...
>Hi.
I'm working on an application with a Data Access Layer, API and UI.
There are some entity classes defined in the DAL which the UI uses
through the API.
This means that there is some coupling between the DAL and the UI.
Is it possible or advisable to separate the DAL completely from the UI?
How can i achieve this?
Thanks,
Sharon.


Oct 28 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
13
by: bobueland | last post by:
I'm a newbie experimenting with Python. I want to incrementally develop a module called 'circle'. The problem is now that the file name is used for two purposes. To keep track of the version number...
4
by: Alan Woodland | last post by:
Hi, I've looked through the FAQ, and I can't seem to find an answer to this one. Can anyone point me to a design pattern that will produce the desired behaviour illustrated below please? I know why...
0
by: George Sakkis | last post by:
Didn't have much luck in the Django list, so I'm posting it here just in case anyone has come up with this problem. Django maintains two parallel hierarchies of field classes, one related to...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.