jennyflower
Programmer
Hi,
I am currently trying to create a simple n-tier application so I can learn the basics of n-tier design and was wondering if someone could look at what I have so far to see if I cam on the right track for an n-tier application to work correctly. I am trying to have a presentation layer, a business logic layer, a provider independant data access layer and the database itself. I am pretty new to vb.net so I apologise if I get any of the terms wrong.
The example I have tried to create is a simple address book, and at the moment have created the bit that inserts titles (like Mr. Mrs. etc) into the database and also brings them out of the database into a combobox.
Right, so on my form (presentation layer) I have a text box, button and combobox. The user will enter a title in the text box, press the button which will add the title to the database then refresh the combobox with all the current titles from the database.
So when the user presses the Add Title button it call a function in the titleBusinessLogic class called CheckTitle()
This checks that there is something in the text box (carries out the business logic) then it calls a function in the DataAccessLayer class called Connect().
This will call another function in a class called Provider Factory, which sends back the correct connection object as a generic IDbconnection object. This is sent back to the data access layer and the connection opened.
Then the Title BusinessLogic class does the same thing for a command object, goes to the dataAccessLayer which goes to the provider Factory class, which sends back a command object as a generic command object.
Once this is done, there is a separate class which deals with the title database stuff called TitleFunctions. here is where i am going to put functions such as addTitle, GetAlltitles, GetOneTitle, DeleteTitle etc.
After looking online at loads of stuff about n-tier design I have tried to separate out the data access layer as much as possible so it is easier to maintain and update at later stages.
Does this setup seem like a good way to create an n-tier application for vb.net?
I am currently trying to create a simple n-tier application so I can learn the basics of n-tier design and was wondering if someone could look at what I have so far to see if I cam on the right track for an n-tier application to work correctly. I am trying to have a presentation layer, a business logic layer, a provider independant data access layer and the database itself. I am pretty new to vb.net so I apologise if I get any of the terms wrong.
The example I have tried to create is a simple address book, and at the moment have created the bit that inserts titles (like Mr. Mrs. etc) into the database and also brings them out of the database into a combobox.
Right, so on my form (presentation layer) I have a text box, button and combobox. The user will enter a title in the text box, press the button which will add the title to the database then refresh the combobox with all the current titles from the database.
So when the user presses the Add Title button it call a function in the titleBusinessLogic class called CheckTitle()
This checks that there is something in the text box (carries out the business logic) then it calls a function in the DataAccessLayer class called Connect().
This will call another function in a class called Provider Factory, which sends back the correct connection object as a generic IDbconnection object. This is sent back to the data access layer and the connection opened.
Then the Title BusinessLogic class does the same thing for a command object, goes to the dataAccessLayer which goes to the provider Factory class, which sends back a command object as a generic command object.
Once this is done, there is a separate class which deals with the title database stuff called TitleFunctions. here is where i am going to put functions such as addTitle, GetAlltitles, GetOneTitle, DeleteTitle etc.
After looking online at loads of stuff about n-tier design I have tried to separate out the data access layer as much as possible so it is easier to maintain and update at later stages.
Does this setup seem like a good way to create an n-tier application for vb.net?