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 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