SlideShare uma empresa Scribd logo
1 de 26
Building Large Scale Apps with Laravel 4
By Darwin Biler
What is a Large Scale App?
A web application that has many features and
complex functions, regularly updated to
accomodate ever-changing business logic. Its
usually used by many people concurrently
and demands scalability and extensibility.
Challenges in Large Application
 Hard to Maintain
 Turns into spaghetti code
 Prone to Security Issue
 Hidden Bugs
 Code collaboration experience is hell
 Hard to test thoroughly
Hard to maintain
A simple change in design requires learning
backend codes, database and other non-frontend
related things. This is usually caused by mixed
html tags with PHP codes that performs database
operations and other non front-end function. What
makes it difficult is a simple change can cause
another set of issues causing an infinite loop of
bug fixing process.
Turns into spaghetti code
With an application codes that is being modified
often, specially being modified by multiple
persons, its too common that different developers
performs some quick and dirty methods of coding
when the existing codes is un structured and
nobody is enforcing a policy of the coding
standards.
Prone to Security Issues
Often times, quick and dirty codes leads to poor
escaping of input, central data cleansing methods
and secure way of exposing database data. This is
the least valued process by most companies
developing their own custom sofware thus making
it susceptible to attacks.
Hidden Bugs
100% of QA tests the software in the frontend
alone, which is completely wrong. Most of the bugs
surfacing in the front-end is usually a problem in
backend gone un noticed. In a very large
codebase, inspection of the backend codes is
more often not done.
Code Collaboration is hell
Have you experienced getting your work
overwritten by someone else? Even with
Github, things could get awful if the application
codes itself overlaps each other, making conflicts
in the codes a common place.
Hard to test thoroughly
When you have a complex application that links to
many 3rd party API, calls various
functions, handles many browser and user
devices, if you do the all possible combination of
those factors, you will figure out there is no way
you can simulate all of those in a reasonable
amount of time and interval.
How Laravel helps to avoid those issues
Inversion Of Control ( IoC )
Namespacing
Dependency Injection
Repository Pattern
Unit-Testing
Modular
SOLID Principle
Facade
Inversion Of Control
Inversion of control is sometimes facetiously
referred to as the "Hollywood Principle:
Don't call us, we'll call you" because its
program logic is the reverse of abstractions
such as callbacks.
Why "Inverted"?
Its called like that because it reverses how
many developers think of the way how a
traditional applications were built
Traditional method
Design > Database > logic
Or
Database > Logic > Design
Design > Database > Logic
 A designer creates a layout in Photoshop
 Frontend developer creates the html/css
 Database tables will be created
 PHP programmer will create the
Controllers, Eloquent models etc
 Layout and other features is coded by
programmer
Database > Logic > Design
 Database tables were created via ERD
 Migration and Eloquent models were
written to manipulate the data
 Features and logic is applied
 Design was made
 Design is converted to HTML and Blade
markup
IoC method
Logic > Database > Design
How is that possible if there is no database or
layout yet?
Think of high level abstractions
Entity - is any object in application that
represents real world object, like
Person, Car, Payment etc.
Repository - is a place to save and retrieve
Entities.
Factory - is a thing that processes a raw data
into an Entity
Entities
 Many people knows it as Model in the
MVC
 Contains the data that is needed by the
application
 Should be passed to the Views and View
Composers
Repository
 A place to store Entities
 Abstracts away the physical location of
data
 Contains the methods to get/retrieve data
 Allows you to swap database or data
source w/o affecting the rest of the
application
Factory
 Creates Entities
 Makes sure Entities has valid data
 Does the hard work of transforming raw
data into Entity
Entity Example:
interface EntityInterface {
public function getID();
}
class Member implements EntityInterface{
public $memberid;
public $username;
public $password;
public $status;
public $email;
public $siteid;
public function getID(){
return $this->memberid;
}
}
Repository Example:
interface RepositoryInterface {
public function get(Array $params);
public function post(EntityInterface $e);
public function put(EntityInterface $e);
public function delete(EntityInterface $e);
}
class MySQLMemberRepository implements RepositoryInterface{
public function __construct(){
// Connect to database
}
public function get(Array $params){
// SELECT Queries in here
// Use Eloquent, or any ORM
}
public function post(EntityInterface $member){
// SQL INSERT HERE
}
public function put(EntityInterface $member){
// SQL UPDATE HERE
}
public function delete(EntityInterface $member){
// SQL DELETE HERE
}
public function __destruct(){
//close connection
}
}
Factory Example:
interface FactoryInterface {
public function create(Array $params);
}
class MemberFactory implements FactoryInterface{
public function create(Array $data){
return new Member;
}
}
Namespacing
Global use of variable in plain PHP script
seems viable when the script is just short.
But once its spans hundreds of lines you
will ending up with many variable collisions.
Causing unpredictable results.
Namespaces allows you to organize your
code so that your Entities, Factory and
Repositories is not neatly organized
Example Namespaces:
namespace VendorProjectNameEntitiesYourEntity;
namespace VendorProjectNameFactoriesYourEntityFactory;
namespace VendorProjectNameRepositoriesYourEntityRepository;
This way, you can mix and match different Entities from multiple company,
without worrying any conflict. For example, both Yahoo, Google and Microsoft
needs a class for Member Entity
var $m1 = new MicrosoftVisualStudioEntitiesMember;
var $m2 = new GoogleDriveEntitiesMember;
var $m3 = new YahooMailEntitiesMember;
That will be the first part of this Presentation
Watch out for Part 2, which covers:
 Dependency Injection
 Repository Pattern
 Unit-Testing
 Modular
 SOLID Principle
 Facade
Thank You!
Darwin Biler

Mais conteúdo relacionado

Mais procurados

Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play FrameworkKnoldus Inc.
 
The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014Matthias Noback
 
Ryan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was GoodRyan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was GoodFITC
 
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsIntroduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsDaniel McGhan
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play frameworkAlexander Reelsen
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSShekhar Gulati
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns Alex Theedom
 
YiiConf 2012 - Alexander Makarov - Yii2, what's new
YiiConf 2012 - Alexander Makarov - Yii2, what's newYiiConf 2012 - Alexander Makarov - Yii2, what's new
YiiConf 2012 - Alexander Makarov - Yii2, what's newAlexander Makarov
 
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)Matthias Noback
 
Playing with parse.com
Playing with parse.comPlaying with parse.com
Playing with parse.comJUG Genova
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat ToolKanika2885
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React AppAll Things Open
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsEffie Arditi
 
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Codemotion
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApiRaffaele Rialdi
 

Mais procurados (20)

Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play Framework
 
The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014
 
Web Development with Smalltalk
Web Development with SmalltalkWeb Development with Smalltalk
Web Development with Smalltalk
 
React native
React nativeReact native
React native
 
Ryan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was GoodRyan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was Good
 
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsIntroduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play framework
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns
 
YiiConf 2012 - Alexander Makarov - Yii2, what's new
YiiConf 2012 - Alexander Makarov - Yii2, what's newYiiConf 2012 - Alexander Makarov - Yii2, what's new
YiiConf 2012 - Alexander Makarov - Yii2, what's new
 
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
Hexagonal architecture - message-oriented software design (PHP Barcelona 2015)
 
Slim Framework
Slim FrameworkSlim Framework
Slim Framework
 
Playing with parse.com
Playing with parse.comPlaying with parse.com
Playing with parse.com
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi Applications
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
 
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApi
 

Destaque

Containerd - core container runtime component
Containerd - core container runtime component Containerd - core container runtime component
Containerd - core container runtime component Docker, Inc.
 
Evolving an Application Architecture
Evolving an Application ArchitectureEvolving an Application Architecture
Evolving an Application ArchitectureGarret Fick
 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravelwajrcs
 
Services Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQLServices Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQLJoe Stump
 
Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture AppDynamics
 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksPhill Sparks
 
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...Aaron Saray
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 

Destaque (9)

Laravel 5 and SOLID
Laravel 5 and SOLIDLaravel 5 and SOLID
Laravel 5 and SOLID
 
Containerd - core container runtime component
Containerd - core container runtime component Containerd - core container runtime component
Containerd - core container runtime component
 
Evolving an Application Architecture
Evolving an Application ArchitectureEvolving an Application Architecture
Evolving an Application Architecture
 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravel
 
Services Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQLServices Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQL
 
Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture
 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill Sparks
 
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 

Semelhante a Building Large Scale PHP Web Applications with Laravel 4

Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web DevelopmentRobert J. Stein
 
Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Joe Ferguson
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's CodeWildan Maulana
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaDavid Chandler
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestJoshua Warren
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016Joe Ferguson
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Pythongturnquist
 
Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaJignesh Aakoliya
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicDavid Solivan
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...Joe Ferguson
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 
Open Source Web Technologies
Open Source Web TechnologiesOpen Source Web Technologies
Open Source Web TechnologiesAastha Sethi
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principlesEdorian
 

Semelhante a Building Large Scale PHP Web Applications with Laravel 4 (20)

Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Current state-of-php
Current state-of-phpCurrent state-of-php
Current state-of-php
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
 
Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company india
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
Open Source Web Technologies
Open Source Web TechnologiesOpen Source Web Technologies
Open Source Web Technologies
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
 

Último

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Último (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Building Large Scale PHP Web Applications with Laravel 4

  • 1. Building Large Scale Apps with Laravel 4 By Darwin Biler
  • 2. What is a Large Scale App? A web application that has many features and complex functions, regularly updated to accomodate ever-changing business logic. Its usually used by many people concurrently and demands scalability and extensibility.
  • 3. Challenges in Large Application  Hard to Maintain  Turns into spaghetti code  Prone to Security Issue  Hidden Bugs  Code collaboration experience is hell  Hard to test thoroughly
  • 4. Hard to maintain A simple change in design requires learning backend codes, database and other non-frontend related things. This is usually caused by mixed html tags with PHP codes that performs database operations and other non front-end function. What makes it difficult is a simple change can cause another set of issues causing an infinite loop of bug fixing process.
  • 5. Turns into spaghetti code With an application codes that is being modified often, specially being modified by multiple persons, its too common that different developers performs some quick and dirty methods of coding when the existing codes is un structured and nobody is enforcing a policy of the coding standards.
  • 6. Prone to Security Issues Often times, quick and dirty codes leads to poor escaping of input, central data cleansing methods and secure way of exposing database data. This is the least valued process by most companies developing their own custom sofware thus making it susceptible to attacks.
  • 7. Hidden Bugs 100% of QA tests the software in the frontend alone, which is completely wrong. Most of the bugs surfacing in the front-end is usually a problem in backend gone un noticed. In a very large codebase, inspection of the backend codes is more often not done.
  • 8. Code Collaboration is hell Have you experienced getting your work overwritten by someone else? Even with Github, things could get awful if the application codes itself overlaps each other, making conflicts in the codes a common place.
  • 9. Hard to test thoroughly When you have a complex application that links to many 3rd party API, calls various functions, handles many browser and user devices, if you do the all possible combination of those factors, you will figure out there is no way you can simulate all of those in a reasonable amount of time and interval.
  • 10. How Laravel helps to avoid those issues Inversion Of Control ( IoC ) Namespacing Dependency Injection Repository Pattern Unit-Testing Modular SOLID Principle Facade
  • 11. Inversion Of Control Inversion of control is sometimes facetiously referred to as the "Hollywood Principle: Don't call us, we'll call you" because its program logic is the reverse of abstractions such as callbacks.
  • 12. Why "Inverted"? Its called like that because it reverses how many developers think of the way how a traditional applications were built
  • 13. Traditional method Design > Database > logic Or Database > Logic > Design
  • 14. Design > Database > Logic  A designer creates a layout in Photoshop  Frontend developer creates the html/css  Database tables will be created  PHP programmer will create the Controllers, Eloquent models etc  Layout and other features is coded by programmer
  • 15. Database > Logic > Design  Database tables were created via ERD  Migration and Eloquent models were written to manipulate the data  Features and logic is applied  Design was made  Design is converted to HTML and Blade markup
  • 16. IoC method Logic > Database > Design How is that possible if there is no database or layout yet?
  • 17. Think of high level abstractions Entity - is any object in application that represents real world object, like Person, Car, Payment etc. Repository - is a place to save and retrieve Entities. Factory - is a thing that processes a raw data into an Entity
  • 18. Entities  Many people knows it as Model in the MVC  Contains the data that is needed by the application  Should be passed to the Views and View Composers
  • 19. Repository  A place to store Entities  Abstracts away the physical location of data  Contains the methods to get/retrieve data  Allows you to swap database or data source w/o affecting the rest of the application
  • 20. Factory  Creates Entities  Makes sure Entities has valid data  Does the hard work of transforming raw data into Entity
  • 21. Entity Example: interface EntityInterface { public function getID(); } class Member implements EntityInterface{ public $memberid; public $username; public $password; public $status; public $email; public $siteid; public function getID(){ return $this->memberid; } }
  • 22. Repository Example: interface RepositoryInterface { public function get(Array $params); public function post(EntityInterface $e); public function put(EntityInterface $e); public function delete(EntityInterface $e); } class MySQLMemberRepository implements RepositoryInterface{ public function __construct(){ // Connect to database } public function get(Array $params){ // SELECT Queries in here // Use Eloquent, or any ORM } public function post(EntityInterface $member){ // SQL INSERT HERE } public function put(EntityInterface $member){ // SQL UPDATE HERE } public function delete(EntityInterface $member){ // SQL DELETE HERE } public function __destruct(){ //close connection } }
  • 23. Factory Example: interface FactoryInterface { public function create(Array $params); } class MemberFactory implements FactoryInterface{ public function create(Array $data){ return new Member; } }
  • 24. Namespacing Global use of variable in plain PHP script seems viable when the script is just short. But once its spans hundreds of lines you will ending up with many variable collisions. Causing unpredictable results. Namespaces allows you to organize your code so that your Entities, Factory and Repositories is not neatly organized
  • 25. Example Namespaces: namespace VendorProjectNameEntitiesYourEntity; namespace VendorProjectNameFactoriesYourEntityFactory; namespace VendorProjectNameRepositoriesYourEntityRepository; This way, you can mix and match different Entities from multiple company, without worrying any conflict. For example, both Yahoo, Google and Microsoft needs a class for Member Entity var $m1 = new MicrosoftVisualStudioEntitiesMember; var $m2 = new GoogleDriveEntitiesMember; var $m3 = new YahooMailEntitiesMember;
  • 26. That will be the first part of this Presentation Watch out for Part 2, which covers:  Dependency Injection  Repository Pattern  Unit-Testing  Modular  SOLID Principle  Facade Thank You! Darwin Biler