DEVELOPING A REAL WORLD
APPLICATION
>_ THINGS LAB
Introducing modern techniques of software engineering through PRACTICE
<?php
try {
  $conn = new PDO("mysql:host=127.0.0.1;dbname=DragonBallZ",
                            $username, $password);
} catch (PDOException $ex) {
  print "Error!" . $ex­>getMessage() ;
  exit();
}
$select = "SELECT character_name FROM super_saiyan WHERE power > 9000;"
$resultSet = $conn­>query($select);
foreach ($resultSet as $result) // this should print Goku!
  print $result['character_name'];
?>
php: hypertext preprocessor
Suited to web development
Easy to learn
Massive online community
THERE ARE PLENTY OF PHP
FRAMEWORKS
Laravel
Phalcon
Symfony
Zend Framework 2
etc.
CodeIgniter
<client‐side/>
<HTML5/> + {CSS3} + JS
CSS FRAMEWORKS
Foundation
Bootstrap
HTML5 UP
HTML5 Boilerplate
Skeleton
JS FRAMEWORKS
A lot more...
AngularJS
Ember.js
Backbone.js
jQuery
DATABASES
Structured Query Language - SQL
A lot more...
Oracle Database
SQL Server
MySQL
PostgreSQL
DB2
An SQL database
NoSQL
Document type -- MongoDB
Key-Value -- Redis
Graph -- Neo4J
DOCUMENT TYPE
{ "_id" : "1", "username" : "thingslab", "website": "www.thingslab.cc"
{ "_id" : "2", "username" : "google", "website": "www.google.al" }
{ "_id" : "3", "username" : "facebook", "website": "www.facebook.com"
{ "_id" : "4", "username" : "twitter", "website": "www.twitter.com" }
KEY-VALUE
{
  "Harry Potter and the Chamber of Secrets": "J. K. Rowling",
  "De motu corporum": "Isaac Newton",
 
  "Love in the Time of Cholera": "Gabriel Garcia Marquez",
 
  "The Castle": "Ismail Kadare"
}
GRAPH
SEARCH ENGINES
WHAT DOES A SEARCH ENGINE
Efficient data indexing
Text Search
Filtering
Word Stemming
Word Stemming
Quality Scoring
Location-based search
LUCENE
Information Retrieval Software Library
Read more here
ELASTIC SEARCH
Search server built on top of Lucene
Free and Open Source
Built in Java == cross-platform
JSON-based REST API
From MySQL to Elastic Search
SOLR
http://solr-vs-elasticsearch.com/
SOLR VS ES
VIRTUALIZED ENVIRONMENTS
Works on my machine...
Easy to configure
Development environment == production environment
Code that Works!
HOW TO DO IT?
$ vagrant init hashicorp/precise32
$ vagrant up
Grab a coffee and let Vagrant do the work
VERSION CONTROL
Version control is a system that records
changes to a file or set of files over time so
that you can recall specific versions later.
For the examples in this book you will use
software source code as the files being
version controlled, though in reality you
can do this with nearly any type of file on a
computer.
OUR CHOICE: git
Git is Fast
Git is Small
Git is Distributed
Git is Easy to learn
Git is The new standard
WHERE TO LEARN GIT?
A lot of practice
Our old presentation
try.github.com
Git tower
Atlassian tutorial
SOFTWARE DEVELOPMENT
METHODS (SDMS)
WATERFALL MODEL
RAPID APPLICATION PROTOTYPING
(RAD)
Creating small, uncomplete prototypes
Brakes the whole project in smaller mini-projects
User involved in the development process
EXTREME PROGRAMMING (XP)
A way to make sure that your code work.
TEST AUTOMATION
will always
WHAT TO TEST?
Platform and OS independence
Use cases
User Interface (browser automation)
Heavy load performance
UNIT TESTING
Automated testing of small units of code
Locate problems early (TDD in XP and Scrum)
Simplifies refactoring
TESTING TOOLS
Karma (test runner - JS)
Protractor (e2e - JS)
PHPUnit
Selenium
CONTINUOUS INTEGRATION
Best CI practices
Maintaining a code repository
Build automation
Self-testing builts
Regular, frequent commits
Build every commit
Fast builds
Test in a clone of the production environment
The results of the latest build are visible
Deployment automation
final words, closing quotes, things like that

Real world Webapp