473,397 Members | 1,950 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,397 software developers and data experts.

CODING PRACTICE. Business and Data Access Layers

Why separate the Data Access Layer (DAL) methods from the Business Layer
(BL)methods of an object ? Why not have them inside the object itself, since
it's going to save its own data, using its own methods?

Is it just a matter of avoiding clutter of the code? Or try to avoid big
objects in memory? Won't the DAL object consume memory by itself anyway?
Any reasonable explanation is appreciated.

TIA
Iordanis

Jul 20 '08 #1
7 2445
its because of the benefits to abstraction. what if the data store
changes, what if the bl layer needs to run on a in-memory model. what if
the underlying database changes? none of these should effect the bl code
unless it has the data access in them.

also for professional developers who write units test, combining the
layers make writing the unit tests more difficult.

-- bruce (sqlwork.com)

Savvoulidis Iordanis wrote:
Why separate the Data Access Layer (DAL) methods from the Business Layer
(BL)methods of an object ? Why not have them inside the object itself, since
it's going to save its own data, using its own methods?

Is it just a matter of avoiding clutter of the code? Or try to avoid big
objects in memory? Won't the DAL object consume memory by itself anyway?
Any reasonable explanation is appreciated.

TIA
Iordanis
Jul 20 '08 #2
#1 Business Objects do not have to exist If and Only If there is a database
counter part. Case #1, UnitTests.
#2 Your backend datastore could change, thus layers give you a better way
to maintain your code.

You can look at an example here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!139.entry
(code is downloadable).

There is a MS "bird's eye view" article I reference. Read and reread that
article several times. Bookmark it, and in a few months, go back and reread
it.


"Savvoulidis Iordanis" <Sa*****************@discussions.microsoft.comwrot e
in message news:79**********************************@microsof t.com...
Why separate the Data Access Layer (DAL) methods from the Business Layer
(BL)methods of an object ? Why not have them inside the object itself,
since
it's going to save its own data, using its own methods?

Is it just a matter of avoiding clutter of the code? Or try to avoid big
objects in memory? Won't the DAL object consume memory by itself anyway?
Any reasonable explanation is appreciated.

TIA
Iordanis

Jul 21 '08 #3
Is the 3-tier approach applied in webforms that use webform controls and
datasources such as gridview the sqldatasource controls? Doesn't the
combination of these controls destroy the 3-tier approach? Should I fill the
gridview with data only through code that gets the data from the business
layer, OR by using gridview/sqldatasource properties (the easy way)? I
believe using both methods is inapropriate.
Any comments? How is it done in serious web page development?

TIA
Iordanis
Jul 21 '08 #4
"Savvoulidis Iordanis" <Sa*****************@discussions.microsoft.comwrot e
in message news:55**********************************@microsof t.com...
How is it done in serious web page development?
Depends on your definition of "serious", I suppose...

Personally, I do everything in code and never go anywhere near things like
SqlDataSource, Validation controls, Design view etc...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 21 '08 #5

Most of those were developed for RAPID development.

In my opinion, RAPID != Good Development.

...

"Savvoulidis Iordanis" <Sa*****************@discussions.microsoft.comwrot e
in message news:55**********************************@microsof t.com...
Is the 3-tier approach applied in webforms that use webform controls and
datasources such as gridview the sqldatasource controls? Doesn't the
combination of these controls destroy the 3-tier approach? Should I fill
the
gridview with data only through code that gets the data from the business
layer, OR by using gridview/sqldatasource properties (the easy way)? I
believe using both methods is inapropriate.
Any comments? How is it done in serious web page development?

TIA
Iordanis

Jul 21 '08 #6
Are applications developed without the datasource controls, but only using
code for gridviews etc, any faster? Why do you follow this approach? Isn't
Rapid App Development the Holy Grail of programming? How faster do you work
coding the way you do now?
Any philosophical discussion on that is appreciated (if you can spare any
time on philosophy, that is)

TIA
Iordanis
Jul 23 '08 #7
"Savvoulidis Iordanis" <Sa*****************@discussions.microsoft.comwrot e
in message news:91**********************************@microsof t.com...
Are applications developed without the datasource controls, but only using
code for gridviews etc, any faster?
No idea...
Why do you follow this approach?
For much greater control over what I'm doing...
Isn't Rapid App Development the Holy Grail of programming?
Absolutely not!!! Rapid application development DOES NOT necessarily mean
good application development. Have you ever seen Microsoft FrontPage...?
How faster do you work coding the way you do now?
Much faster.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 23 '08 #8

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

Similar topics

1
by: AMeador | last post by:
I am doing a project where we need to read a write data to a database (SQL Server 2K in this case). I have seen the use of data binding to link a property of a control to a field in a record set...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
16
by: MS newsgroup | last post by:
I don't have clear reasons why we need business logic layer and data logic layer instead of having only data logic layer. Are there any good reasons for that?
4
by: pratham | last post by:
Hi! I'm making a database application and i heard from a friend that it is more proffecional and easy to do this with bussines objects. Can anyone tell me where i can find more info on bussines...
25
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as...
7
by: Steve | last post by:
I am building an object library for tables in a database. What is the best practice for creating objects like this? For example, say I have the following tables in my database: User: - Id -...
4
by: ajmastrean | last post by:
Folks, What are the best practices, pros/cons, performance, scalability considerations in choosing the source/type for an object's ObjectDataSource (consider a GridView that needs to display a...
8
by: Charles Law | last post by:
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,...
0
by: JTP PR | last post by:
Business Intelligence software company, Yellowfin today announced its successful foray into the Asia Pacific telecommunications sector through its expanding partner network. Two organisations,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.