Three tier architecture in simple words

Application Development:
-Companies adopt an architecture for designing of application which will contain few layers in it like:
    -Presentation Layer (UI)
    -Business Logic Layer
    -Data Logic Layer
    -Database Layer

Presentation Layer (UI):
-It is the place from where users interact with an application, from here only users supplies their input or view their output.
-The screens which are required in your application has to be designed with help of User Controls using "Windows Forms Control Library" project type and then loaded from an Windows Form (exe).

Business Logic Layer:
-Under this layer we define common functionalities that are required with in the application accessible to all projects of the application.
-These are also referred as libraries, which needs to be developed with class library project template because libraries are always dlls.

Data Logic Layer:
-It is the layer which contains code related with DB or Data Source operations. It was the single point from where all data base realted operations get performed. The advantage with this layer is when ever changes were required under the data source related code it can be done from here.

Note: values like connection string, address, phone no's etc., which require frequent changes should not be hard coded under source code because, these val's may require changes to them and as we do not provide source code to end users they can not make changes. To overcome these problems, all the values which require changes by users were maintained under a seperate file i.e. "Configuration File".

-Every application will have this Configuration File as "app.config" under which we maintain data that can be modified by clients when required, as it was an xml file users can edit & make changes to it. Under this file only we maintain all the information that requires changes.

-Config file has to be added under StartUp project of our application (exe) by opening "Add New Item" window & select "Application Configuration File". We need to maintain values in config file as key value pairs. By default config file get's created with <configuration> </configuration> tag, under which we need to specify key value pairs as following:

           <add key="<key>" value="<value>"/>

-To read values of the config from our application following the below process:
1. Add the reference of System.Configuration assembly.
2. Import the namespace System.Configuration.
3. Now using ConfigurationManager class start reading the values:
string str =
    ConfigurationManager.AppSettings.Get("<key>");

-Database layer is the place under which we store the data.
Ebook Download
View all
Learn
View all