Saturday, 17 September 2016

Chapter-1 Introduction to Web Application Development using Asp.net MVC




Visual Studio .NET allows you to create applications that can access World Wide Web. With help of traditional HTML pages which can run on intranet or internet using business-to-business applications providing Web-based components that can exchange data using XML.

Asp.Net web application work, the part of a web application, how the Microsoft .NET Framwork is organized and how to use the Microsoft Visual Studio .NET programming environment.

There are four type of Internet Application:

Web Application: These application provide content from a server to machine over Internet. User can view the application through a browser. Web Application used in Asp.Net, Web Form, System.Web namespace. 

Web Services: These component provide processing services from a server to application over the Internet. We can use Web Service in Asp.Net, XML Web Services, System.Web.Services namespace.

Internet Enabled Application: It is standalone application that run on internet for online registration, help in update and retrieve the data from database to Internet. We can use in Internet enable Application in Microsoft windows forms, Html, Web Browser, System.Net namespace.

Peer to Peer Application: It is standalone application that use internet to communicate with other users running their own instance of application. We can use in Peer to Peer Application in Accessing in Internet, Pluggable protocol, System.Net and System.Net.Sockets namespace.

Among all technologies, the Internet is the fastest growing technology, which:

  1. Has changed the way business is conducted.
  2. Helps organizations to reach a larger range of people, irrespective of their geographical locations.
  3. Helps organizations in sharing and accessing information from anywhere, anytime.
  4. Has changed the focus of application development from desktop applications to Web applications.
Defining Web Applications

Web applications:
  1. Are programs that are executed on a Web server and accessed from a Web browser.
  2. Web application use a client/server architecture. On client side, the wed application is hosted by a browser .The application use HTML( Hyper Text Markup Language) to display page by client browser. On server side application run on IIS (Internet Information Services).
  3. Enable organizations to share and access information on the Internet and corporate intranets.
  4. Can support online commercial transactions, popularly known as e-commerce.
Note: IIS manages the application ,passes request from clients to application and returns the application response to client.

The following figure shows the working of a Web application.
Web application

The Three Layers of a Web Application

1.       All Web applications can be broken into three layers.
2.       Each layer has its own components and functionality. 

The following figure depicts the various layers that constitute a Web application.

Web application

What is Layer?
A layer is a reusable portion of code that performs a specific function.

In the .NET environment, a layer is usually set up as a project that represents this specific function to achieve specific goal.

The layers of a Web application are:

1)      Presentation layer 

a)      Allows interaction with user. It is top layer in the application that translate task and result to something to user can understand. 

2)      Business logic layer 

a)      Controls the flow of execution and communication between the presentation layer and the data layer. It coordinate with application ,processes command and make logical decision and evaluate  and perform calculation.  

3)      Data layer 

a)      Exposes the application data stored in databases to the business logic layer.

Architecture of a Web Application

An application can have one of the following types of architectures:

1)      Single-tier architecture
2)      Two-tier architecture
3)      Three-tier architecture
4)      N-tier architecture

In an application based on single-tier architecture:

1)      All the three layers are integrated together and can be installed on a single computer.
2)      If the application needs to be accessed on multiple computers, a separate installation is required on each computer.
3)      1-Tier Architecture is single tier on single user that equivalent of running an application on a personal computer.
4)      User interface, business logic, and data storage are all located on the same machine.

The following figure displays the single-tier architecture.

single-tier architecture
In an application based on two-tier architecture:

1)      The three layers are distributed over two tiers, a client and a server.
2)      The presentation layer resides on each client computer.
3)      The business logic layer resides either on the client or on the server.
4)      The data access layer resides on the server.
5)      A web browser makes a request from a web server, which then processes the request and returns the desired response.

Two-tier architecture

1)      Fat client and  thin server : In fat client and thin server architecture, the business logic layer resides on the client.
2)      A thin client is designed to be especially small so that the bulk of the data processing occurs on the server.

The following figure displays the fat client and thin server architecture.

thin server architecture

3)      Fat server and thin client : In fat server and thin client architecture, the business logic layer resides on the server.
4)      A thick client (also called a fat client) is one that will perform the bulk of the processing  in client/server applications.

The following figure displays the thin client and fat server architecture.

fat server architecture.

In an application based on three-tier architecture:

1)      The three layers of the application are placed separately as three different entities.
2)      Communication among the layers occurs with the help of a request-response mechanism.

The following figure displays the three-tier architecture.
three-tier architecture

N-tier architecture:

1)      Involves further separation of the presentation layer and the data layer.
2)      May divide the presentation layer into the GUI layer and the presentation logic layer.
3)      May divide the data layer into the data access layer and the data layer.
4)      3-Tier Architecture is most commonly used to build web applications. In this model, the browser acts like a client, middleware or an application server contains the business logic, and database servers handle data functions.
5)      Separates the various business processes into discrete units of functionality called services.
6)      Provides improved flexibility and scalability of applications, as compared to the three-tier architecture.
7)      This approach separates business logic from display and data. So the 3 layers commonly known as: Presentation Layer(PL/UI),Business Logic Layer(BLL) & Data Access Layer(DAL).

Introduction to Web Pages

1)      A Web application consists of certain Web pages.
2)      A Web page is a Web document that can be accessed through a Web browser.
3)      Web pages can be:
a)      Static
b)      Dynamic

Creating a Dynamic Web Page

1)      To create a dynamic and interactive Web page, you need to use scripting.
2)      Scripting
a)      Client-side
b)      Server-side
3)      Client-side scripting
a)      Enables you to develop Web pages that can dynamically respond to user input.
b)      Helps reducing the network traffic.
c)       Speeds up the response time of a Web application.

The following figure displays the working of client-side scripts.

client-side scripts


Server-side scripting

1)      Provides users dynamic content that is based on the information stored at a remote location, such as a back-end database.
2)      Includes code written in
server-side scripting technologies, such as Active Server Pages (ASP) and JavaServer Pages (JSP).

The following figure displays the working of server-side scripts.


server-side scripts
Click here Chapter-2 Web Application Development using Asp.net MVC
Summary:

1)      Web applications are programs that are executed on a Web server and accessed from a Web browser.
2)      An application can have one of the following types of architectures:
a)      Single-tier architecture
b)      Two-tier architecture
c)       Three-tier architecture
d)      N-tier architecture
3)      A Web page is a Web document that can be accessed through a Web browser.
4)      To create a dynamic and interactive Web page, you need to use scripting, which includes:
a)      Client-side scripting
b)      Server-side scripting

I hope that the functionality of the above attribute is clear to you now. Now you can use this code in your application. If you have further question, just drop a line below and I will try to answer you as soon as possible.

Last but not least, connect with me on Twitter , Facebook , LinkedIn and Google+ for technical updates and articles news. We won’t spam or share your email address as we respect your privacy.



1 comment:

  1. It would be better if you use the responsive layout

    ReplyDelete