Results 1 to 8 of 8

Thread: Architecture discussion anyone?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2003
    Location
    Beer City
    Posts
    33

    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

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    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.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2003
    Location
    Beer City
    Posts
    33
    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

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    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.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2003
    Location
    Beer City
    Posts
    33
    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

  6. #6
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    are you using datasets? then you can update them when you have finished editing/adding using the dataAdapter and command builder.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  7. #7

    Thread Starter
    Member
    Join Date
    Jan 2003
    Location
    Beer City
    Posts
    33
    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

  8. #8
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    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.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width