General questions about 3-tier architecture with webservices

N

Nightfall

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

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
 
N

Nightfall

I have to use web services and I'm trying to build my software using 3-
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?
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?

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top