VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
Ps02 cint24 mvc in php
1. Institute Name: Shree P.M.Patel Institute of Post Graduation Studies and Research in
Applied Science
Managed By: Anand People Medicare Society, Anand
Seminar Topic: MVC in PHP
Seminar By,
Kavankumar Nileshkumar Solanki
MSc.IT 2ND Semester
Roll No.: 03
2. Objectives
Challenges Faced when Designing an Application Without Framework
Introduction to MVC
What is MVC?
Benefits of MVC
Popular MVC Frameworks
DRY
Bibliography
3. Challenges Faced when Designing
an Application without a Framework
Complexity in Coding in straight
PHP
Everything must be tested; which is difficult
Difficult to re-use code
Hard code everything from scratch
Teamwork challenges -parallel programming cannot be done efficiently
4. Introduction to MVC
• Software development is not a new idea. Ada Lovelace is said to have written
the first computer program in the mid-nineteenth century for the Analytical
Engine, the first mechanical computer prototyped by Charles Babbage.
• Designing good software is hard.
• It involves taking into consideration all aspects of the application you need to
build, and is complicated further by the need to be specific enough to your
current requirements to get the job done, while being generic enough to
address future problems.
• Many experienced developers have had these problems and, over time,
common patterns have emerged that assist in solving them.
• Christopher Alexander, a structural architect, first described patterns in such
a way that they can be applied to software development. He said, “Each
pattern describes a problem which occurs over and over again in our
environment, and then describes the core of the solution to that problem, in
such a way that you can use this solution a million times over, without ever
doing it the same way twice.”
5. What is MVC?
MVC (Model-View-Controller) is a software design pattern built around the
interconnection of three main component types, in a programming language
such as PHP, often with a strong focus on object-oriented programming
(OOP) software paradigms.
The three component types are loosely termed models, views, and
controllers.
6. Model
The model is where all the business logic of an application is kept.
Business logic can be anything specific to how an application stores data,
or uses third-party services, in order to fulfill its business requirements.
If the application should access information in a database, the code to do
that would be kept in the model.
7. View
The view is where all of the user interface elements of our application
are kept. This can include our HTML markup, CSS style sheets, and
JavaScript files.
Anything a user sees or interacts with can be kept in a view, and
sometimes what the user sees is actually a combination of many different
views in the same request.
8. Controller
The controller is the component that connects models and views
together. Controllers isolate the business logic of a model from the user
interface elements of a view, and handle how the application will
respond to user interaction in the view.
Controllers are the first point of entry into this trio of components,
because the request is first passed to a controller, which will then
instantiate the models and views required to fulfill a request to the
application.
9. Benefits of MVC
• There is no point explaining what MVC is without knowing why you
should use it. Remember Christopher Alexander’s patterns that I
mentioned earlier?
• MVC is one of the many patterns that will be explained in this book, but
to understand the usefulness of this design pattern, we must look toward
the problems it helps to alleviate.
10. Popular MVC Frameworks
• There are many great PHP frameworks availible, but if we limit our view
to just three, I think we can get a good idea of what they have in
common, and what makes each special.
• These are not the best or the only PHP MVC frameworks, but simply a
good cross-section of the different approaches to PHP MVC
development.
11. CodeIgniter
• CodeIgniter is the first and simplest of the frameworks we will be looking
into.
• It is developed and maintained by Ellis Lab and can be described as an
open source Expression Engine.
• You can download CodeIgniter at http://codeigniter.com.
• You can also learn more about EllisLab and ExpressionEngine at
http://ellislab.com.
12. Zend Framework
• Zend Framework is an extensive collection of loosely coupled
code libraries that can form the basis of an MVC architecture.
• Zend Framework takes quite a bit of effort to understand and
master relative to other popular MVC frameworks.
• It is developed by Zend Technologies and enjoys all the benefits
of a large, stable community and wide adoption.
• Whereas frameworks like CodeIgniter strive to be lightweight,
favoring just the essentials, Zend Framework includes libraries
that help developers utilize a wide range of third-party services
and APIs.
• You can download Zend Framework at
http://framework.zend.com.
• You can also learn more about Zend at http://zend.com.
13. CakePHP
• CakePHP is arguably the most popular of the three frameworks.
• Unlike the previous two frameworks, it is not governed by any one
corporate entity.
• It has a large community and is widely adopted.
• It favors convention over configuration, which means a lot of the finer
details are assumed and automated.
• This is apparent in every area of the framework, and you will often find
yourself wondering how CakePHP is doing something you didn’t ask it to
do, both good and bad.
• This means you can develop an application quickly, but also that you
might have a hard time when you need to make very specific changes.
14. Continue
• This is even seen in the code-generation command-line tool: Bake.
• Within minutes, it can generate a working application, just by following
command-line prompts and filling in the blanks with default parameters
and behaviors.
• You can download CakePHP at http://cakephp.org.
15. DRY
• DRY just means "Don't Repeat Yourself". Make sure that when you write
code, you only write it one time.
• The DRY principle is stated as "Every piece of knowledge must have a
single, unambiguous, authoritative representation within a system."
16.
17. Bibliography
Pro PHP MVC Chris Pitt APRESS Nov-2012
• Webinar on Principles of MVC For PHP Developers by EDUREKA ON
04/Aug./15
[ http://www.edureka.co/php-mysql]