Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

General questions about 3-tier architecture with webservices

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nightfall - 07 Feb 2008 13:02 GMT
I have a database about students, university, departments etc etc.
I have to build a gui (windows application) to access and manage data
in this database.
I have to use web services and I'm trying to build my software using 3-
tier architecture.

First question: how many web services should I create?

Let's say the GUI has different section like "Department management",
"Students management" etc.
Should I create a different webservice for any different section?
For example,
the Student Management section connects to StudentsManagement WS which
should have methods like GetStutendByCountry etc
Or maybe I should do a big unique "Service" for any webmethod?

Then... in visual studio I've created folders for

DTO (data transfer objects... for example "Student")
BAL (business access layer)
DAL (data access layer)

Secondo question:
If I have different web service
- StudentManagementWS
- DepartmentManagementWS

should I have
StudentManagementDAL.cs and DepartmentManagementDAL.cs in DAL and
StudentManagementBAL.cs and DepartmentManagementBAL.cs in BAL

or maybe there should be a unique DAL.cs in DAL folder and BAL.cs in
BAL folder?

Third question:
I connect to sql express database using a connection string in
web.config.
In my DAL classes I often repeat

string cs =
ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;
SqlConnection conn = null;
SqlDataReader reader = null;
etc etc... to open, use, and close the connection

How can I get rid of this repetition? Maybe creating a class that
provides SqlConnection and SqlDataReader objects? Is this what someone
call "Proxy" pattern?

Fourth question
do I really need to use WebService -> DTO -> BAL -> DAL to populate a
combobox which is going to list "Department A", "Department B"?

Fifth question
In this combobox I just have to put the name of the department. But in
my DTO, a Department has got its address, civic number, telephone
number etc. etc.
So if I use "WebService -> DTO -> BAL -> DAL" I build many objects but
I use just a field (name of dept)... isn't this waste?

Thank you to anyone is going to reply,

best regards
Ignacio Machin ( .NET/ C# MVP ) - 07 Feb 2008 14:19 GMT
Hi,

> I have to use web services and I'm trying to build my software using 3-
> tier architecture.

why you "have to" ?

> First question: how many web services should I create?

Again, why you must use them in the first place? where r they going to be
located?
You could do it with only one service with several methods or different
services with one method.

> Let's say the GUI has different section like "Department management",
> "Students management" etc.
> Should I create a different webservice for any different section?

What data each department will handle? will be different security for those
modules?

If you provide more details about thre requirements you might get a better
sugestion of how to implement it

Signature

Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.

Nightfall - 07 Feb 2008 14:39 GMT
> > I have to use web services and I'm trying to build my software using 3-
> > tier architecture.
>
> why you "have to" ?

Ok, this is hard question... because I'm not really convinced I need
webservices.
I have the DB and these requests:
1) build a windows form gui to access and update records
2) build a web page to access and update a very little "sub-set" of
data in the database.

Probably there will be
3) build an application exactly like (1) but for PDAs

I thought 1+2+3 = I need to use webservices.
Ehm... do you agree?

> > First question: how many web services should I create?
>
> Again, why you must use them in the first place? where r they going to be
> located?

What do you mean with located?

> You could do it with only one service with several methods or different
> services with one method.
Ok, and my question is: why should I use one service with several
methods? and why different services with one method?

> > Let's say the GUI has different section like "Department management",
> > "Students management" etc.
> > Should I create a different webservice for any different section?
>
> What data each department will handle? will be different security for those
> modules?

Same security for each module.

> If you provide more details about thre requirements you might get a better
> sugestion of how to implement it

thank you very much!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.