MVC Report
MVC Report
MVC Report
CHAPTER 1
INTRODUCTION
The rapid development of the internet for web application development brought forward a
higher demand of efficiency, reliability, maintainability and scalability. PHP has features of
intuitive, easily top of hand, run fast, cross platform, open source, etc., thus it became one of the
most important Web development language. While, the PHP development model mixes the code of
data access, the processing of business logic ,and web presentation layer together, as a result, it
brought about many problems in the web applications . MVC design pattern is a proven effective
way of the generation of organized modular applications. As a design pattern, MVC is common to
split an application into separate layers that can be analyzed, and sometimes implemented,
separately. By decoupling models and views, MVC helps to reduce the complexity in architectural
design and to increase flexibility and reuse of code. This will propose a development framework of
PHP based on the MVC design model, which might be an effective separation of data access, logic
processing and user interface, and thus it could promote the efficiency and quality of PHP
development[5].
The Model-View-Controller (MVC) design pattern is cited as the basis for the architecture
of several web application frameworks, such as ASP .Net, Rails, and Struts. The MVC pattern was
originally implemented in the Smalltalk-80 programming environment developed at Xerox PARC
(Goldberg and Robson, 1985). As it has been adapted for web frameworks the MVC pattern has
evolved in different ways, resulting in implementations that differ significantly from each other
and from the original Smalltalk implementation[4].
Web application framework usually implements the Model View Controller (MVC) design
pattern. The MVC pattern is a proven, effective way for the generation of organized modular
applications. The MVC pattern breaks an application into three modules: model, view and
controller. The model module contains the underlying classes whose instances are to be used for
manipulating the database. The programmers learn how to use each class and what the output is,
rather than on SQL syntax. This advantage can reduce the syntax error of SQL commands. In
addition, the programmers create the controller module merely to handle the user events and create
the view module to render the appearance of the data in the user interface. By decoupling the
module, MVC helps to reduce the complexity in architectural design and to increase flexibility and
reuse of code. This research will propose a development of the PHP framework for database
management, based on the MVC design model, which will be an effective separation of event
handling, underlying classes and user interface[1].
PHP provides a framework that aims to accelerate the process of developing a website.
Today, there are many object oriented programming based framework that uses full-stack model
design to MVC (Model View Controller) design. The use of these designs, especially MVC design,
is to provide ease in web application development. Writing the code is becoming more systematic
and reusable[8].
In addition, the use of framework greatly helps programmers in the development of large-
scale applications that involve a lot of people in it. With the framework, the code will be organized
so that it can be easily understood by other programmers. There are many choices of use
framework. Among them, there is Zend framework which is devoted to enterprise scale. However,
this framework is rarely used because it is less popular compared with CodeIgniter and Yii
framework. CodeIgniter is quite mild and can run faster than other frameworks. But the drawback
is the absence of features ORM (Object Relational Mapping), so that it becomes more
complicated when used in large applications. While the Yii framework has better features than
CodeIgniter, but slower performance than CodeIgniter. To overcome the disadvantages of the 2
framework, it is built a new framework namely Becak HMVC. This framework is designed to
simplify the design pattern and minimize the number of files. From the test results, it was found
that the framework Pedicab HMVC have drawbacks such as the lack of library cache (temporary
storage) and AJAX (Asynchronous JavaScript and XML). As a result, the performance of this
framework is still not maximal[10].
The main goal is to follow the process of development of a responsive and mobile-friendly
web application relying on Model-View-Controller pattern principles to build its server-side
functionality. The application in question contains three core components: relational database
designed and implemented using the MySQL database management system, backend functionality
built with the Codeigniter 3 MVC framework and frontend design using the Twitter Bootstrap 3
component library. This thesis mostly focuses on the server-side application development with less
attention being paid to the database and frontend design.
The clean structure of the Model-View-Controller pattern provides a good starting ground
for the responsive web application development in which separate program components can be
further exchanged, revised or reused with minimum effort from the application developer. In a
properly designed MVC application these operations will also have a small impact on the
application source code or its other components.
Another important factor to consider is how actively the framework is supported by the
community. Having a strong and active community of developers and end-users is important to
secure further growth and longevity of the framework. Sharing user experiences, creating new
resources, writing guides and making extensions is just a small part of what an active framework
community can do. With that in mind, there are many popular PHP frameworks in the industry that
support the MVC pattern[9].
In this chapter, firstly PHP Development Framework is discussed. After that, MVC Pattern
is discussed.
CHAPTER 2
LITERATURE SURVEY
The MVC design pattern was introduced with the Smalltalk programming environment as a
way to structure interactive applications in a modular fashion (Krasner and Pope, 1988). As the
name implies, the MVC design pattern decomposes functionality into three major components.
The model component encapsulates the domain specific structure and functionality of the
application. This essentially includes the state of the application and operations that can change
state. The model also maintains dependencies of view and controller components, which it notifies
in the event of changes in state.
This behavior is an instance of the Observer pattern (Gamma, Helm, Johnson and
Vlissides, 1995). The view component presents information to the user through a graphical user
interface. There may be multiple views of different types operating within the application,
presenting different views to multiple users. Views may also be hierarchical, constructed from
smaller (sub view) elements. When information contained in a view is updated (by a model
component that is responsible for that information) the view is notified by the model and then the
view may query the model to obtain information that it needs to present. The controller component
responds to user actions via the user interface. It is responsible for passing transactions to the
model for execution. Controllers exist in a one-to-one correspondence with views. The hierarchy
of views is therefore also replicated among the corresponding controllers. When a controller
receives input, it yields to its active sub controllers first, so that input is processed at the lowest
levels of the controller hierarchy first[6].
Web design study included different types of strings like "web development assessment"
and "web development performance". In conclusion, most of the material is generally evaluated,
not about the performance of web development. The search for data was about to evaluate
performance and the selection of materials research in this area was not profitable but it was not
easy to find. Important It is a good way to find out how to do research in this data and it is often
found in an abstract but sometimes in the background[4].
In 2001 Samisa Abesingh, mainly focused on how the M-V-C and framework techniques
makes difference in web development. In this book MVC is a major part of PHP development and
is about what it does for web development.
In 2001, Peter Savacek and John Bartlett understood web performance. He presented how
the display can be used and how it is important in web business. It also shows how testing can be
done and how the test can be affected. This paper lets developers know how to manage value and
time in web application development.
In 2015, David Diaz Clavozo compared the practical Azil Web framework, in which he
compared the codiginiter, cakePHPt and the Lorevele Framework. He also reviewed the
framework for an effective website development by a developer where he reviewed the various
web applications developed using this framework. CodeIgniter is also a MVC based PHP
framework, written by Rick Ellis. The CodeIgniter Framework has certain features, e.g. There are
no restrictive coding rules, no need Template language learning, small but extensive libraries and
complete documentation. These features are suitable for small and medium sized utensils. In
CodeIgniter, There is no databaselike object-relational mapping (ORM). Due to the absence of
ORM in the CodeIgniter framework, database communication becomes complex and unsafe. There
is a client request process in MVC is as given below[5]:
a. the index.php serves as front controller in the CI, that initializing the base resources needed to
run MVC smoothly.
b. Router examine the HTTP request to determine what should be done with request.
c. If cache file already exists, it’s then sent to the browser, by sending normal system execution.
d. Security is loaded Before application controller, HTTP request & any user submitted data is
filtered for security.
e. the Controller loads model, helpers, core libraries and the other resources needed to process the
specific request of the user.
f. The finalized View is then rendered and sent to the browser to be displayed. If the caching is
enabled, then view is first cached so that on subsequent requests it can be served. Framework is a
set of libraries that are organized in architectural design to deliver the speed, accuracy,
convenience and consistency in development of such applications, framework contains following
elements:
File library
Methodology
Architecture
If this framework is associated with the word PHP ,it can be interpreted as a patterned framework
that enables easy web development using PHP language[1] .
In this chapter, literature survey of PHP Development Framework based on MVC Pattern is
discussed.
CHAPTER 3
METHODOLOGY
The clean structure of the Model-View-Controller pattern provides a good starting ground
for the responsive web application development in which separate program components can be
further exchanged, revised or reused with minimum effort from the application developer. In a
properly designed MVC application these operations will also have a small impact on the
application source code or its other components.
A faster and more efficient way to develop MVC-based applications is to utilize a dedicated
web framework that comes with all necessary functionality out of the box. There are multiple
factors to consider when selecting an appropriate MVC framework for the needs of a specific
project. According to, it may be useful to narrow the selection by answering a few related
questions first:
For example large and complex web frameworks with a rich set of features may be better suitable
for big and long-term maintenance projects but are not necessarily an optimal choice for smaller
ones. Similarly, frameworks with a steep learning curve, while often being able to provide more
built-in functionality, will take more time and resources to learn how to utilize them properly. It is
also important to keep in mind that even if a particular framework is up-to-date at the moment it
may quickly become outdated receiving no further support from developers.
3.1.1 CONTROLLER
Simply put the controller is the main component of any MVC-based application that
connects models and views together. Controllers serve as a buffer between Model and View
components, isolate the business logic of the model from the user interface layout of the view and
handle data interactions between them. Model-View-Controller basic interaction can be seen in
Figure 3.1. Controllers can also be considered as a first point of entry in MVC-based applications.
An incoming browser request will be passed to the dedicated controller first, which will try to
process it and instantiate correct models and views in order to respond to it properly[7].
. Database
View Action
template Controller
View
Logic
Front Controller
INTERNET
Client
3.1.2 MODEL
The model is a MVC component, in which the application business logic is stored. The
term ‘business logic’ refers to all data and business functionality that the specific application
works with. It describes how the application in question stores and manages its data or uses third
party services in order to fulfill its business requirements.
In practice this means that outside of few possible exceptions all database-related code will
be placed inside the model classes. For example, when application retrieves specific data from the
database, updates and puts it back into the database, it requires an appropriate model or set of
models to define these interactions.
In Codeigniter 3 models are optional classes designed to operate with the application
database and provide different methods to access and manage its data. Models can be loaded and
called within the controller by using appropriate load-class methods. Alternatively models can be
auto-loaded during the system initialization phase by adding the specific model to the auto-load
array in the autoload.php configuration file[6].
3.1.3 VIEW
The view is the frontend part of an application in which all user interface components are
stored. Anything that users can see or interact with through web browsers can be found in view
files. The list includes for example HTML markup, CSS stylesheet and JavaScript files. All
frontend and JavaScript based frameworks that work with data presentation are also presented [4].
Being a presentation layer of the application the view is basically a normal HTML page or
a page segment that includes dynamically generated content via PHP code. The main difference of
the MVC views from the normal web pages is that views, unlike their traditional counterparts, can
never be called directly: they can only be loaded by calling their representative MVC controller
methods. Multiple views can be combined with each other or embedded (nested) within other
views in order to build more complex page presentation. Specific views such as headers, footers
and RSS feeds can also be reused between multiple application controllers.
View is an object what users can see, it is the presentation part of the application. Typically
view is the part of system where the HTML is generated and displayed the modeled data. All
views are located in view folder. View does not have any connection with model, and it is
responsible to produce presentational interface by using available information. It can display
different kind of formats depending on users need for example, music, videos, xml etc[2].
MVC request in CakePHP start from requesting a page or resource by a user, after requesting this
resource it is processed by dispatcher that correspond to the relevant controller to handle it. When
the controller receives the request, it corresponds to the model layer for receiving, adding, editing
or deleting data. Once the data has been processed as per the user’s request, the controller will then
select the corresponding view object to generate output resulting from the data provided by the
model. When the output is finalized, it is then send to the user [3].
View
Model
6 7
3 4
Client
1 Dispatcher 2 Controller
Figure 3.3 explains the MVC cycle after a user requests a resource, a dispatcher that corresponds
to the correct controller object to deal with it initially processes the request. After this request
reaches the controller, it will correspond with the model layer to process the CRUD (create, read,
update and delete) operation that might be needed. After that the controller proceeds to delegate
the correct view object for generating output result from data provided by the model [3].
MVC architecture arranges the code into logical segments. It separates the modelview-
controller and converts application code into maintainable, user-friendly, and modular. It is easy to
add new functionalities and reuse the same code. MVC architecture made it easy to add new
features and functionalities in the application. It also makes it possible for back-end and front-end
developers to work more efficiently. The separation of model, view, and controller makes it easy
for developers to make changes in one part of application without affecting the others.
One of the major benefits of using the MVC pattern is that the front-end developers can
work on user interface without having to worry about the underlying data management, and back-
end developers can focus on the data logic without getting in details of the presentation [6].
In the modern software design patterns where the UI elements, data logic and programming
logic are at same place, the maintenance of the application becomes harder as it grows in size. As
all the parts in MVC are well defined and self-contained, it makes the changes much easier and
efficient.
Its simplicity, documentation, performance and community make it the most popular web
framework for PHP developers[5].
In this chapter, architecture of MVC framework, MVC Cycle and MVC benefits are
discussed.
CHAPTER 4
IMPLEMENTATION
This section describes the detailed implementation of the Job Portal, methods used to develop the
application, the structure of the project with its functionalities.
4.1 PURPOSE
The main goal of this web application is to offer a service for job seekers and companies to meet
for offering and applying to different positions e.g. trainee and internship positions, thesis work,
summer time, part-time and full time jobs. The service enables all schools and universities and
students from all over the country to meet companies and vice versa.
The purpose of this online web portal is to give a platform for finding the right and satisfactory job
according to the requirements and qualifications. It also connects the job seekers with the
companies.
Companies and job seekers do not specifically need to register/login themselves to use this
application. Companies have limited options to advertise their job advertisement with the
capability of editing or deleting the same advertisement. On the other hand job seekers can also
apply for any position without any need of login to the application with limited functionality.
4.2 SCOPE
The scope of this application is to introduce a user-friendly web portal that provides the job
information, online applying for jobs and many other facilities. The main scope of the application
is:
This module provides functionalities for job seekers who are students or any one from any
profession. Registered applicants can post their personal and professional details with resumes.
They can edit or delete their data if required. Job seekers also get email alerts from the employers
on the basis of their preferences. Job seekers can also apply for any job without the need of
registration or login to the system to upload their resume and other general information.
Employer Module
The employer module is for companies or public sectors that are interested in hiring new
people for the vacant posts. An employer can post a detailed advertisement for a job and also
update or delete it if required.
The employer can also post a new advertisement without the need of registration/login, in this case
they can get an email notification if someone applies for the specific job position[11].
Administrator Module
This module is for the administrator of the application who has all the control of the system.
The administrator manages the whole application and maintains the profile of employers and
applicants. Administration features include:
The application is easy to use and it provides flexibility to the users to use the service as they want.
The job portal is designed to fulfill the need of jobseekers and also employers. Jobseekers
can be any student, fresh graduate or an experienced person who wants to find new job as per their
skills. On other hand the employer can be any start-up company or a medium or large size firm
who has difficulties to find suitable candidate to accomplish their needs. The main goal of this job
portal is of provide an easy to use web portal where users can facilitate with minimum IT
knowledge.
The flow of job portal is very smooth and easy to understand even for new users. There are
two main parts of the application, which makes it unique and different from other job portals in the
market. These are registered users and non-registered users. The application is well structured for
the use and is easily reachable with basic browser from all over the world[11].
The functional architecture (MVC) of the Online Job portal application is depicted below –
HTTP Browser
REQUEST REPONSE
REQUEST
JAVA SERVLET
Generate
Generate Results
Form Controller Web
Input Report
Screen
Model View
Worker Beans
Database
EJBs
Figure 3.4: The Functional Architecture (MVC) of the Online Job Portal Application.
4.4.1 Codeigniter
CodeIgniter is an open source rapid development web application framework, for use in building
dynamic websites with PHP. Its goal is to enable to develop projects much faster than writing code
from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple
interface and logical structure to access these libraries. The first public version of CodeIgniter was
released on February 28, 2006, and the latest stable version 2.1.4 was released July 8, 2013 [7].
4.4.2 CakePHP
CakePHP is an open source web application framework. It follows the Model-View Controller
(MVC) approach and is written in PHP, modeled after the concepts of Ruby on Rails, and
distributed under the MIT License.[7] .
CakePHP uses well-known software engineering concepts and software design patterns, as
Convention over configuration, Model-View-Controller, Active Record, Association Data
Mapping, and Front Controller.
4.4.3 Symfony
Symfony is a PHP web application framework for MVC applications. Symfony is free software
and released under the MIT license. The symfony-project.com website was launched on October
18, 2005.[7]
4.4.4 Laravel
Laravel is a free, open source PHP web application framework, designed for the development of
MVC web applications. Laravel is released under the MIT license, with its source code hosted on
GitHub[7].
In this chapter, Purpose of the system, Scope of the system, System design and MVC Design
Frameworks are discussed.
CHAPTER 5
5.1 ADVANTAGES
5.2 DISADVANTAGES
1) Increased complexity.
2) Inefficiency of data access in view.
3) Difficulty of using MVC with modern user interface.
4) Need multiple programmers.
5) Knowledge on multiple technologies is required,
6) Developer have knowledge of client side code and html code.
7) The view and the controller are closely coupled which marks modification to one affect
the other.
8) Changes to the model interface will necessitate changes to the controller and the view.
9) When the model is active frequent changes to model can result in excessive updates of
the corresponding views.
CHAPTER 6
CONCLUSION
FDF framework is a web application development, framework based on the MVC Patten. The PHP
framework for database management based on MVC pattern is proposed. It completed the
separation of the user interface and business logic of the systems development supplied the basic
methods and clarity of the accomplishment of the design of the framework. It prepares the basic
methods and clarity in the accomplishment of the design of the framework that can develop a web
application for database manipulation. This PHP MVC framework takes the full advantages of its
loosely coupled, expansibility, and reusable quality.
CHAPTER 7
REFERENCES
[1] Umi Sa’adah, Jauari Akhmad NH, Masfu Hisyam, “Implementing Singleton method in Design
of MVCBased PHP Framework”, International Electronics Symposium (IES) IEEE, 2015, pp.
212-217.
[2] Wei Cui, Lin Huang, LiJing Liang, Jing Li, “The Research of PHP Development Framework
Based on MVC Pattern”, Fourth International Conference on Computer Sciences and
Convergence Information Technology, 2009.
[3] Chanchai Supaartagorn, “Php Framework For Database Management Based On Mvc Pattern”,
International Journal of Computer Science & Information Technology (IJCSIT), Vol 3, No 2,
April 2011.
[4] Amit S. Thawari, Dr. S. E. Yedey, “Study Of Codeigniter Technology”, International Journal
of Research in Computer & Information Technology (IJRCIT), Vol. 1, Special Issue 2, July-
2016.
[5] Vijayakumar C, “Analysis of the Frame work Standard and the Respective Technologies”,
IRACST - International Journal of Computer Science and Information Technology & Security
(IJCSITS), Vol.1, No. 1, October 2011.
[6] Trupti Tawari, Prof. A. J. Nathe, “Comparative Study Of Different Frameworks Of Php”,
International Journal of Research in Computer & Information Technology (IJRCIT), Vol. 1,
Special Issue 2, July-2016.
[7] RashidahF.Olanrewaju, Thouhedul Islam and Nor'ashikin Bte. Ali, “An Empirical Study Of
The Evolution Of PHP MVC Framework”, International Islamic University Malaysia, January
2015.
[8] Jevgeni Anttonen, “Building a responsive web application with the MVC PHP framework”,
Spring 2018.
[9] Ali Raza Fayyaz , Madiha Munir , “Performance Evaluation of PHP Frameworks (CakePHP
and CodeIgniter) in relation to the Object-Relational Mapping, with respect to Load Testing”,
School of Computing at Blekinge Institute of Technology.
[10] Connor Patrick, “Literature Review Service Frameworks and Architectural Design Patterns in
Web Development”, Computer Science Honours University of Cape Town, 15 May 2014.
[11] Jevgeni Anttonen, “Building a responsive web application with the MVC PHP
framework”,Lahati University of Applied Sciences, 2018.