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

n-Tier doubt!!

Hello everyone,

I'm with a lot of questions about how to design a n-Tier, how to do
the code how to organize, and all the samples that i find, are with
only one table, one class with DataAcess, i need something more
"Complex"..

maybe you guys have a little sample with maybe a User class, and a
UserGroup class that is related with the User class...and a Project
class that is connected with a Client class that is connected with a
ClientContacts class...and the Project class have a ProjectStatus...

my biggest doubt is what should i do when designing them???

is this right?

public class Client
{
private string _Name = string.Empty;

public string Name
{
get
{ return _Name; }
set
{ _Name = value; }
}
public void Insert() {
//Access to DAL
}
public void Delete() {
//Access to DAL
}
public void Update() {
//Access to DAL
}

public class Contact
{
private string _Name = string.Empty;

public string Name
{
get
{ return _Name; }
set
{ _Name = value; }
}

public void Insert()
{
//Access to DAL
}
public void Delete()
{
//Access to DAL
}
public void Update()
{
//Access to DAL
}

}

}
because that sucks...

i have to declare the Client class...if i want to access the Contacts
form a Client i have to:

Client.Contact Contact = new Client.Contact();
Contact.Name..etc..

need help please...

thanks in advance...

Sep 5 '07 #1
3 1297

You can check my example at:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry

I have a strong inclination to seperate the Client class from the class
(ClientManager or ClientController) that creates the Client class.

Please note a difference between N-Layered and N-Tiered designs. My example
is N-Layered, because all code is deployed on a single machine.

Go a google search for N-Tier and N-Layer and you'll find defintions for
them.
Good luck.


"IsRaEl" <yz****@gmail.comwrote in message
news:11**********************@r29g2000hsg.googlegr oups.com...
Hello everyone,

I'm with a lot of questions about how to design a n-Tier, how to do
the code how to organize, and all the samples that i find, are with
only one table, one class with DataAcess, i need something more
"Complex"..

maybe you guys have a little sample with maybe a User class, and a
UserGroup class that is related with the User class...and a Project
class that is connected with a Client class that is connected with a
ClientContacts class...and the Project class have a ProjectStatus...

my biggest doubt is what should i do when designing them???

is this right?

public class Client
{
private string _Name = string.Empty;

public string Name
{
get
{ return _Name; }
set
{ _Name = value; }
}
public void Insert() {
//Access to DAL
}
public void Delete() {
//Access to DAL
}
public void Update() {
//Access to DAL
}

public class Contact
{
private string _Name = string.Empty;

public string Name
{
get
{ return _Name; }
set
{ _Name = value; }
}

public void Insert()
{
//Access to DAL
}
public void Delete()
{
//Access to DAL
}
public void Update()
{
//Access to DAL
}

}

}
because that sucks...

i have to declare the Client class...if i want to access the Contacts
form a Client i have to:

Client.Contact Contact = new Client.Contact();
Contact.Name..etc..

need help please...

thanks in advance...

Sep 5 '07 #2
IsRaEl wrote:
I'm with a lot of questions about how to design a n-Tier,
I think you question is about an object model and rather unrelated
to n-tier (and n-layer).
how to do
the code how to organize, and all the samples that i find, are with
only one table, one class with DataAcess, i need something more
"Complex"..

maybe you guys have a little sample with maybe a User class, and a
UserGroup class that is related with the User class...and a Project
class that is connected with a Client class that is connected with a
ClientContacts class...and the Project class have a ProjectStatus...

my biggest doubt is what should i do when designing them???

is this right?

public class Client
{
private string _Name = string.Empty;

public string Name
{
get
{ return _Name; }
set
{ _Name = value; }
}
public void Insert() {
//Access to DAL
}
public void Delete() {
//Access to DAL
}
public void Update() {
//Access to DAL
}

public class Contact
{
private string _Name = string.Empty;

public string Name
{
get
{ return _Name; }
set
{ _Name = value; }
}

public void Insert()
{
//Access to DAL
}
public void Delete()
{
//Access to DAL
}
public void Update()
{
//Access to DAL
}

}

}
because that sucks...

i have to declare the Client class...if i want to access the Contacts
form a Client i have to:

Client.Contact Contact = new Client.Contact();
Contact.Name..etc..
I would move Contacts class out of Client class.

I would prefer to have the DAL access storing/retrieving/modifying
class X outside of class X.

I would have a constructor with argument (and one without).

Arne

Sep 9 '07 #3
Arne Vajhøj wrote:
I would move Contacts class out of Client class.

I would prefer to have the DAL access storing/retrieving/modifying
class X outside of class X.

I would have a constructor with argument (and one without).
Note that the above is just some comments to the posted code not what
is necessary for a good object model.

Arne
Sep 9 '07 #4

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...
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...
122
by: ivan | last post by:
hi all, if I have: if(A && B || C) which operation gets executed first? If I remeber well should be &&, am I correct? thanks
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: 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: 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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.