|
-
May 23rd, 2003, 09:01 AM
#1
Thread Starter
Member
Architecture discussion anyone?
Hello all, have been .netting for a while now and am starting to get the idea of classing out things and now I have a question.
Please feel free to comment or add any thoughts about the following.
My basic architectural belief is:
for the GUI,
The Gui forms should know little or nothing about the data they display. That is to say if I have for instance a form for "New Employees" the validation of the FirstName field should be a function of a class "employee" the GUI should just reference it and let the class do the testing.
For the Class,
The class should Know all of the data it contains and how to retrieve it from the database. The Class validates the data, gets the data etc.
for the DataBase
The Database only Presents the data. it does not do anything to the data for the gui. for example if you have a dropdown that you want to populate and you want the first row to be called "Select a department" you would NOT program it into the SQL procedule with a union. you would instead program it at the gui level.
Does this sound like the right direction or am I way off base?
any comments would be welcomed
Tal McMahon
its called the "F1" key-- use it
-
May 23rd, 2003, 09:29 AM
#2
Fanatic Member
sounds good to me. this is the way i've been trying to head as well.
You could have a data access class as well where the class that does all the validation passes the dataset to the data access class and it is this classes job for doing the reading writing to the database.
-
May 23rd, 2003, 09:32 AM
#3
Thread Starter
Member
O.K.
so your saying have a class for example "Employee" that does the Employee Stuff data wise. Then have another Class Like "EmployeeDataBaseConnection" that would have Add, get, delete and edit type methods for database interaction.
cool.
tal
its called the "F1" key-- use it
-
May 23rd, 2003, 09:36 AM
#4
Fanatic Member
sounds about right. It's more something i've read about than implemented at the moment but i will be looking at doing it myself in the not to distant future.
-
May 23rd, 2003, 09:39 AM
#5
Thread Starter
Member
O.k.
Then would you implement it on a single record basis (i.e. newEmployee.add) Or would you then build a collection of employees and at the end of the session do a bulk insert ?
tal
its called the "F1" key-- use it
-
May 23rd, 2003, 09:42 AM
#6
Fanatic Member
are you using datasets? then you can update them when you have finished editing/adding using the dataAdapter and command builder.
-
May 23rd, 2003, 09:47 AM
#7
Thread Starter
Member
Wan't really looking at at the How to part of this. I figure I could use a dataset if I wanted to do multiple insertions or I would just use a single cmd if it was singletons.
tal
its called the "F1" key-- use it
-
May 23rd, 2003, 09:50 AM
#8
Fanatic Member
all depends which way you want to program it. Don't think there is a right or wrong answer. Just depends i suppose on whether you will be pulling large datasets(in terms of number of records) from the database. If you are then it would be better looking at doing it one by one.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|