473,406 Members | 2,620 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,406 software developers and data experts.

n-tier apps - what to use

Hi,

I'm implementing a 3-tier app (a shop) for the first time, and would like to
have some of you guys comment on the design. Hope you can help me get rid of
some confusion.

I have a data-tier, business-tier and GUI

In the data-tier I have all my data code - connection to SQL Server, and
getting and pushing data. One methods could be DateReader
GetDataDatareader(string SQL) or DataSet GetDataDataset(string SQL) and
there could be ExeceueNonQuery(string SQL) for any delete or
update-operations. There is only a few methods in this class.

In the middle tier we find all classes related to business objects. The
could be a Client and Clients-class, Item and Items-class and so on. Each
class have a few static methods to create objects. A client might have a
FindClient(id) method, and in the method there could be code to call data
tier and convert a datareader-object to and object of Client.

In the GUI tier where ASP.NET (or a PDA or WinForm or...) is showing info
from the business tier (items could bind to a datagrid), and when a clients
data is updated in a ASP.NET form its a middletier objects fields/property
that's chanced, and a call to an Update-methods in the business tier ends op
with generation SQL an calling ExecuteNoneQuery in the data tier.

Hope you understand my bad English (and my design). How does this design
look to you. Data layer is the only thing communicating with SQL Server,
Business layer is using data layer to get data and update data, and GUI is
only using the business layer. Is that the right way of doing it?

If so - I can see the point of separation data from the GUI, and it makes
sense to you classes to represent the data (easy to send a client a mail -
it just a method on the client-class, and the client object already knows
its on e-mail address). The GUI is now kinda simple to develop - its more
about design than code, and the only code would be validation and "binding"
code.

But doesn't this model "cost" a lot in performance. The alternative could be
to implement the data layer in the business layer (when Client object is
generated the call to SQL Server is in the GetClient-methods - its not
forwarded to the data layer). This should be faster - or what? Is that a
design you could recommend - I mean - whats really the point of a data
layer? Im not gonna replace our SQL Server to another database ( we might
update it - but never replace it)

In short - would it be ok to use a 2 tier app in stead of a 3 tier app?

Hope all this makes sense?

Thanks
Nov 21 '05 #1
1 1127
Anders,

Have a look at this page, in my opinon it gives all answers on your
question.

http://msdn.microsoft.com/library/de...ldntierapp.asp

Where I advice you when you are not with a team not to start with a N-Tier.
In my opinion you will see than soon that when you can not make something,
you create very soon some fast solutions to pass dificulties which make your
N-Tier again a 2-Tier or (3-
Tier when it ASPNET) application.

However the last is just my thought

Cor

"Anders S. Willumsen" <an**********@yahoo.com>

I'm implementing a 3-tier app (a shop) for the first time, and would like
to have some of you guys comment on the design. Hope you can help me get
rid of some confusion.

I have a data-tier, business-tier and GUI

In the data-tier I have all my data code - connection to SQL Server, and
getting and pushing data. One methods could be DateReader
GetDataDatareader(string SQL) or DataSet GetDataDataset(string SQL) and
there could be ExeceueNonQuery(string SQL) for any delete or
update-operations. There is only a few methods in this class.

In the middle tier we find all classes related to business objects. The
could be a Client and Clients-class, Item and Items-class and so on. Each
class have a few static methods to create objects. A client might have a
FindClient(id) method, and in the method there could be code to call data
tier and convert a datareader-object to and object of Client.

In the GUI tier where ASP.NET (or a PDA or WinForm or...) is showing info
from the business tier (items could bind to a datagrid), and when a
clients data is updated in a ASP.NET form its a middletier objects
fields/property that's chanced, and a call to an Update-methods in the
business tier ends op with generation SQL an calling ExecuteNoneQuery in
the data tier.

Hope you understand my bad English (and my design). How does this design
look to you. Data layer is the only thing communicating with SQL Server,
Business layer is using data layer to get data and update data, and GUI is
only using the business layer. Is that the right way of doing it?

If so - I can see the point of separation data from the GUI, and it makes
sense to you classes to represent the data (easy to send a client a mail -
it just a method on the client-class, and the client object already knows
its on e-mail address). The GUI is now kinda simple to develop - its more
about design than code, and the only code would be validation and
"binding" code.

But doesn't this model "cost" a lot in performance. The alternative could
be to implement the data layer in the business layer (when Client object
is generated the call to SQL Server is in the GetClient-methods - its not
forwarded to the data layer). This should be faster - or what? Is that a
design you could recommend - I mean - whats really the point of a data
layer? Im not gonna replace our SQL Server to another database ( we might
update it - but never replace it)

In short - would it be ok to use a 2 tier app in stead of a 3 tier app?

Hope all this makes sense?

Thanks

Nov 21 '05 #2

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

Similar topics

0
by: tstephan | last post by:
In the past we have used the classic nTier design with COM+, SQL Server and MFC. We are currently working on a new project with an opportunity to use .NET, ADO.NET, etc. One of the areas where I...
25
by: Stuart Hilditch | last post by:
Hi all, I am hoping that someone with some experience developing nTier apps can give me some advice here. I am writing an nTier web app that began with a Data Access Layer (DAL), Business...
0
by: Glenn Engelbart | last post by:
I am trying to find out a way to get more code re-use & object orientation in the UI portion of my apps. (There already is plenty of both in the DataAccess & Business Logic portion of my apps. ...
3
by: Mark | last post by:
Ok, I know that .net inherently does not share session data across asp.net projects, but is there any decent work around to this. We already have a big chunk of our application using the asp.net...
5
by: Ryan Ternier | last post by:
I know how this should be done in regards to nTier, but it seems a bit inneficient, and was wondering if there's a solution that I havn't thought of yet. (I'm switching this loop to For Each Row...
1
by: Dnx | last post by:
hi i'm a very beginner of visual studio .net 2003 and aspx/vb.net i have to create a project with an architecture ntier i understand the concept but in practical, i don't know where to begin... ...
0
by: Jon Vaughan | last post by:
Hello, I have an NTIER Model written in VB.NET, at the moment is running as a client / server. Pushing a pulling data from the client to the server is fine and is done via webservice calls. But...
0
by: Jon Vaughan | last post by:
Hello, I have an NTIER Model written in VB.NET, at the moment is running as a client / server. Pushing a pulling data from the client to the server is fine and is done via webservice calls. But...
0
by: acnx | last post by:
I have an ntier application. I am trying to determine what is the best practice for handing errors in a datagrid. My datagrids are able to add, update and delete data. I am using a...
0
by: fra | last post by:
Ciao a tutti, è disponibile on line un esempio completo di progetto NTier da usare come base per lo sviluppo di una web application strutturata?? Intendo un esempio con gestione corretta dei vari...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.