




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































ISMT FOUTH SEMESTER | TINKUNE, GAIRIGAU
CENTRAL ZOO NEPAL
The data is then presented to the user within their browser as information is generated dynamically (in a specific format, e.g. in HTML using CSS) by the web application through a web server. Fig: Architecture of Key Web Components and Technologies Web Application Basically, web application is an interactive system which is developed to allow the users to execute business logic that exists in server and to view the results of that logic through a web browser on client workstation. The communication of client and server takes place over the internet in a web application. As a whole, the data is processed by web services and is made available to the users quickly and easily through their web browsers in a web application. A web application or web app is any application software that runs in a web browser or is created in a browser-supported programming language (such as the combination of JavaScript, HTML and CSS) and relies on a common web browser to render the application. Web applications can be simple website, ecommerce sites, business account
package, college management system, library management system, airlines or vehicle reservation system, e-banking etc. Web apps have several advantages over desktop applications. Since they run inside web browsers, developers do not need to develop web apps for multiple platforms. For example, a single application that runs in Chrome will work on both Windows and OS X. Developers do not need to distribute software updates to users when the web app is updated. By updating the application on the server, all users have access to the updated version. Another significant advantage of building and maintaining web applications is that they perform their function irrespective of the operating system and browsers running client side. Web applications are quickly deployed anywhere at no cost and without any installation requirements (almost) at the user ‘s end. How web application works? Web applications have basically three layers to their model. The first layer is on the user's side and consists of a basic browser. The second layer contains a dynamic content generation tools like Java, active server pages, or PHP. The third layer is where the data is stored and consists of back end database software. In general, web application works when the initial request is triggered by the user through the browser over the Internet to the web application server. The web application accesses the databases servers to perform the requested task updating and retrieving the information lying within the database. The web application then presents the information to the user through the browser.
Advantages of web applications: The advantages of the web applications have made a number of users move from the desktop applications to the web applications. Some of the advantages are mentioned below:
1. Cross platform compatibility:- Most web based applications are far more compatible across platforms than traditional installed software. Typically, the minimum requirement would be a web browser of which there are many. (Internet Explorer, Firefox, Netscape to name but a few). These web browsers are available for a multitude of operating systems and so whether you use Windows, Linux or Mac OS you can still run the web application. 2. Highly deployable Due to the manageability and cross platform support deploying web applications to the end user is far easier. They are also ideal where bandwidth is limited and the system and data is remote to the user. At their most deployable you simply need to send the user a website address to log in to and provide them with internet access. This has huge implications allowing you to widen access to your systems, streamline processes and improve relationships by providing more of your customers, suppliers and third parties with access to your systems. 3. More manageable
Web based systems need only be installed on the server placing minimal requirements on the end user workstation. This makes maintaining and updating the system much simpler as usually it can all be done on the server. Any client updates can be deployed via the web server with relative ease.
4. Secure live data Typically, in larger more complex systems data is stored and moved around separate systems and data sources. In web based systems these systems and processes can often be consolidated reducing the need to move data around. Web based applications also provide an added layer of security by removing the need for the user to have access to the data and back end servers. 5. Reduced costs Web based applications can dramatically lower costs due to reduced support and maintenance, lower requirements on the end user system and simplified architecture. By further streamlining your business operations as a result of your web based application additional savings can often be found ( Dbnetsolutions.co.uk, 2015). Disadvantages of web applications: Dependency- As web applications are dependent on the internet, slow internet connection hampers the running of web apps. Development- Developing a web software takes more time as compared to the desktop software. Security - There are certain security issues, which need to be addressed, when it comes to web based applications. There are chances of it being hacked, whether knowingly or unknowingly. Therefore, more care has to be taken to work on this concern
Functions of Web Application: A web based application is defined as a collection of logically related interactive functions that fulfil a specific business requirement as defined by a knowledgeable user of the internet. One web site can provide access to multiple web applications. It is important to establish applications boundaries clearly at the outset of counting. The architecture of web applications comprises multiple components. The purpose for counting determines which components are to be included within the scope of a particular count. For most organizations, only functionality actually built by their developers is included. (Total Metrics, 2014) Fig: How do web application work? PHP A server scripting language, and a powerful tool for making dynamic and interactive Web pages quickly is simply PHP. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP files can contain text, HTML, CSS,
JavaScript, and PHP code PHP code are executed on the server, and the result is returned to the browser as plain HTML. PHP files have extension ".php " (PHP,n.d.). 4 years after the introduction of PHP 4 to the Internet scene, aimed to bring a brand new functionality to the PHP language PHP 5 was released. The PHP team was paying attention on what was missing or not well supported in the older versions. The 5th revision is focused on 3 major areas: Object-Oriented programming, XML and MySQL support (PHP 5,n.d.). Since, the basic classes are supported in version 4 of PHP, the PHP version 5 is re- written supporting complete OOP with better performance and much more features compared to earlier version. Most of the web developers desire to use PHP 5. Furthermore, it is reasonably effortless to use as it comprises easy formats, techniques and characteristics that can be clutched easily by developers. Features of PHP The Standard PHP Library (SPL) is introduced providing a number of ready-made classes and interfaces. Access Modifiers are added. The built-in exception classes in PHP 5 has made easier to create desired customized exceptions via inheritance. Improved MySQL extension called mysqli has been introduced so that the features of MySQL database versions 4.1 and later can be supported.
supports almost any web browser as well as integrating into almost any server. It enables users to add a few lines of code to PHP document, save and watch the transformed website into a powerful and more organized version of itself. Supports all major databases- PHP supports all major databases such as MySQL, dBase, IBM DB2, InterBase, FrontBase, ODBC, PostgreSQL, SQLite, etc. Principles of PHP
1. Object oriented PHP Object-oriented programming refers to the method of programming that invokes the use of classes to organize the data and structure of an application. The PHP has begun OOP life with PHP 4. The object-oriented PHP ease the transition from procedural to object-oriented programming. In PHP we can define objects, assign their properties and make them do things programmatically. The objects are only exist in program but we can interact through user interface as web pages and make them perform certain task and properties. Similarly, we can define classes. A class is a wrapper that defines and encapsulates the object along with all of its methods and properties. Within a class wrapper, the values of specific properties of object can be define or modify and make them to do things. The main goals of object oriented programming are: Increased understanding Ease of maintenance
Ease of evolution Fig: class wrapper In the above example line 3 defines the name of user as ‘user’. Line 5 defines the name of the user as property. The public part means that it is accessible from everywhere throughout the application. Line 7 calls the __construct method which when called will run as the class in instantiated. Line 9-11 check if the name of the user is passed into the constructor as an argument, and, if not, we simply assign the name of the user as "John Doe" OOP Concepts Class: This is a programmer-defined datatype, which includes local functions as well as local data. You can think of a class as a template for making many instances of the same kind (or class) of object. Object: An individual instance of the data structure defined by a class. You define a class once and then make many objects that belong to it. Objects are also known as instance. Member Variable: These are the variables defined inside a class. This data will be invisible to the outside of the class and can be accessed via member
Encapsulation: refers to a concept where we encapsulate all the data and member functions together to form an object.
2. Error handling and exception handling Although solving all the bugs and potential errors in our code sounds like a nice idea, it's not really possible. The main reason for this is because it's hard to predict how our code will operate in all scenarios, so we can't write code to handle it all. With PHP 5 came a new object oriented way of dealing with errors. Exception handling is used to change the normal flow of the code execution if a specified error (exceptional) condition occurs. This condition is called an exception. This is what normally happens when an exception is triggered: The current code state is saved The code execution will switch to a predefined (custom) exception handler function Depending on the situation, the handler may then resume the execution from the saved code state, terminate the script execution or continue the script from a different location in the code Similar to other programming language, PHP has exception model which are important that provides a better control over error handling. The key word related to exception handling are:
Try : Function using an exception should be in ‘try’ block. The code will continue as normal if the exception doesn’t trigger. If the exception trigger then it is thrown. Throw : This is how you trigger an exception. Each throw must have at least one catch. Catch: A catch block retrieves an exception and creates an object containing the exception information Some of the advantages are mentioned below: Provides much more data than simple. Provides the facility of advanced error handling. Makes the flow of a program much more natural. Convenient to communicate the errors. Allows distinguishing between different types of errors and is also great for routing.
3. Session handlers