feature driven agile oriented web applications

133
Feature Driven Agile Oriented Web Applications Ram G Athreya

Upload: ram-g-athreya

Post on 24-May-2015

411 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Feature driven agile oriented web applications

Feature Driven Agile Oriented Web Applications

Ram G Athreya

Page 2: Feature driven agile oriented web applications

Why is Web Dev important

– More and more major businesses and industries are being run on software and delivered as online services (Web Applications)

– Six decades into the computer revolution, four decades since the invention of the microprocessor, and two decades into the rise of the modern Internet, all of the technology required to transform industries through software finally works and can be widely delivered at global scale.

– In 2000 cost of running a Web Application was $150,000 now it is around $1,500 a month

• Why Software is eating the world(By MARC ANDREESSEN)

Page 3: Feature driven agile oriented web applications

Why is Web Dev important

– The world’s largest retailer today is Amazon its core capability is software (not procurement or supply chains etc)

– Largest video service is Netflix (in US) which is also a Software Company not a Cable related company

– Major music companies are Spotify & iTunes not a record label

Page 4: Feature driven agile oriented web applications

The List goes on• Retail – Amazon Software• Communication – Whatsapp, Facebook• Games – Zynga, Rovio• Entertainment – Spotify, iTunes, Pandora,

Netflix• Photography – Flickr • Advertising/Marketing – Google • Telecom – Skype• Recruiting – Naukri, LinkedIn, Monster

Page 5: Feature driven agile oriented web applications

Also Physical Industries• Cars – Android Auto, Apple AirPlay• Real World Retailer – Wal-Mart (its core is S/W)• Marketplaces – EBay• Couriers – FedEx & UPS (powered by S/W &

smart analytics)• Banks – All banks have moved online• Healthcare & Education are next on the list• Health – Fitness apps, Healthkit & wearables• Education – Online platforms (Coursera, Udemy)

Page 6: Feature driven agile oriented web applications

Challenges

• First of all, every new company today is being built in the face of massive economic headwinds, making the challenge far greater than it was in the relatively benign '90s.

• Secondly, many people in the U.S. and around the world lack the education and skills required to participate in the great new companies coming out of the software revolution.

Page 7: Feature driven agile oriented web applications

Agenda

• Cover the whole spectrum of web application development

• Current cutting edge technology that is widely used

• Suitable example that will make understanding easier

Page 8: Feature driven agile oriented web applications

Problem Statement

• Develop a single page stock market app• Features– Search Bar– Current stock price & G/L– Graph– Additional details such as Volume etc– News related to the stock– Send to E-Mail

• Ideally should also work in mobile

Page 9: Feature driven agile oriented web applications

Wireframe

Page 10: Feature driven agile oriented web applications

Web Dev Architecture

Page 11: Feature driven agile oriented web applications

Web Dev Architecture

• Backend– Handle HTTP Requests & generate responses– Communicate with database– Communicate with third party APIs

• Frontend– Communicate with server– Display content from server responses– Presentation of content & user interactivity

Page 12: Feature driven agile oriented web applications

Backend Stack

• Server side language• Web Framework• DBMS• Server• Environment (OS)

Page 13: Feature driven agile oriented web applications

Server Side Technologies

Page 14: Feature driven agile oriented web applications

PHP Frameworks

Page 15: Feature driven agile oriented web applications

PHP Frameworks Performance

Page 16: Feature driven agile oriented web applications

DBMS

Page 17: Feature driven agile oriented web applications

Server

Page 18: Feature driven agile oriented web applications

Environment

Page 19: Feature driven agile oriented web applications

The LAMP Stack

• Linux

• Apache

• MySQL

• Php

Page 20: Feature driven agile oriented web applications

Why we need a Web Framework

• MVC Architecture• URL Mapping• Web Templates & theming• Easy Database Connectivity• User management• Data Persistence• Security• Caching

Page 21: Feature driven agile oriented web applications

MVC Architecture

• Model

• View

• Controller

Page 22: Feature driven agile oriented web applications

MVC in Yii

Page 23: Feature driven agile oriented web applications

MVC Workflow in Yii

Page 24: Feature driven agile oriented web applications

Application

• The application object encapsulates the execution context within which a request is processed

• Its main task is to collect some basic information about the request, and dispatch it to an appropriate controller for further processing.

Page 25: Feature driven agile oriented web applications

URL Mapping

• Pattern matching• Creating user friendly URLs

Page 26: Feature driven agile oriented web applications

Web Templates & theming

Page 27: Feature driven agile oriented web applications

Easy Database Connectivity

• Built on top of PHP Data Objects

Page 28: Feature driven agile oriented web applications

Easy Database Connectivity

Page 29: Feature driven agile oriented web applications

ORM

• Object-relational mapping in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language.

Page 30: Feature driven agile oriented web applications

ORM

• Student Table– Student ID– Name– Teacher ID

• Teacher Table– Teacher ID– Name

Page 31: Feature driven agile oriented web applications

ORMclass student{

public $student_id;public $name;public $teacher_id;public function rules(){

return array( array(’name', 'validateName'), // Custom validation method in this object);

} public function relations() { return array( ’Teacher' => array(self::HAS_MANY, ’teacher', ’teacher_id'), ); }}

Page 32: Feature driven agile oriented web applications

ORM

• $student = Student::model()->findByPk(1);• var_dump($student->student_id)• var_dump($student->name);• var_dump($student->teacher_id);

Page 33: Feature driven agile oriented web applications

Active Record• Active record is an architectural pattern found

in software that stores its data in relational databases.

• A database table or view is wrapped into a class

• This pattern is commonly used by object persistence tools, and in object-relational mapping (ORM)

• Typically, foreign key relationships will be exposed as an object instance of the appropriate type via a property.

Page 34: Feature driven agile oriented web applications

Active Record

• $student = Student::model()->findByPk(1);• var_dump($student->Teacher->name);

Page 35: Feature driven agile oriented web applications

User management

• Yii provides built in user management, access control & authentication mechanisms

• By default a user table can used to provide access to users

Page 36: Feature driven agile oriented web applications

Data Persistence

• Generally used for session handling

Page 37: Feature driven agile oriented web applications

Security

• Cross Site Scripting Prevention (OWASP Top 10)

• CSRF Prevention (OWASP Top 10)• Cookie Attack Prevention

Page 38: Feature driven agile oriented web applications

Caching

Page 39: Feature driven agile oriented web applications

Setup

• cd WebRoot• php YiiRoot/framework/yiic.php webapp webapp-name• .htaccess configuration

RewriteEngine onRewriteBase /

RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_URI} !\.(png|gif|ico|swf|jpe?g|js|css|ttf|svg|eot|woff)$ [NC]RewriteRule . index.php

Page 40: Feature driven agile oriented web applications

Gii

http://hostname/testdrive/index.php?r=gii

Page 41: Feature driven agile oriented web applications

Frontend Stack

• HTML – Content• CSS – Presentation• JS – Interactivity• CSS Preprocessor• Javascript Framework• Responsive Design

Page 42: Feature driven agile oriented web applications

Web Debugging Tools

• Chrome Web Inspector• Firebug for Firefox

Page 43: Feature driven agile oriented web applications

CSS Preprocessor

Page 44: Feature driven agile oriented web applications

CSS Overview• Inline• Internal• External• CSS hierarchy• !important Rule• CSS Inheritance• CSS3 Transitions• CSS3 Transforms• CSS3 Animations

Page 45: Feature driven agile oriented web applications

Inline

Page 46: Feature driven agile oriented web applications

Internal

Page 47: Feature driven agile oriented web applications

External

Page 48: Feature driven agile oriented web applications

CSS Hierarchy

• External < Internal < Inline

Page 49: Feature driven agile oriented web applications

!important Rule

Page 50: Feature driven agile oriented web applications

CSS Inheritance

Page 51: Feature driven agile oriented web applications

CSS3 Transitions

Page 52: Feature driven agile oriented web applications

CSS3 Transforms

Page 53: Feature driven agile oriented web applications

CSS3 Animations

Page 54: Feature driven agile oriented web applications

Features of CSS Preprocessors

• Variables• Mixins• Nested Rules• Media query bubbling• Operations• Functions• Importing

Page 55: Feature driven agile oriented web applications

Variables

Page 56: Feature driven agile oriented web applications

Mixins

Page 57: Feature driven agile oriented web applications

Nested Rules

Page 58: Feature driven agile oriented web applications

Media query bubbling

Page 59: Feature driven agile oriented web applications

Operations

Page 60: Feature driven agile oriented web applications

Functions

Page 61: Feature driven agile oriented web applications

Importing

Page 62: Feature driven agile oriented web applications

Vector Icons

• Icomoon.io• Fontastic

Page 63: Feature driven agile oriented web applications

Importance of UI/UX

• The goal of user interface design is to make the user experience and interaction with your system as simple and efficient as possible

• A good experience leads to more user satisfaction & better conversions or purchases

Page 64: Feature driven agile oriented web applications

Fedex Logo

• Won over 40 design awards• Rated as one of the best designs focusing on

negative space• Once you understand the significance you will

never forget the brand

Page 65: Feature driven agile oriented web applications

Skeumorphism vs Flat Design

Page 66: Feature driven agile oriented web applications

WIMP Model

• Windows

• Icons

• Menus

• Pointer

Page 67: Feature driven agile oriented web applications

A/B Testing

Page 68: Feature driven agile oriented web applications

Javascript Frameworks

Page 69: Feature driven agile oriented web applications

JS Overview

• JS Event Loop• Objects• Callbacks• Closures• Prototypes• Inheritance

Page 70: Feature driven agile oriented web applications

JS Event Loop

Page 71: Feature driven agile oriented web applications

Objects

• Short Quiz – Which of these is an object in JS?– Object– Function– ArrayYes it is a trick question

Page 72: Feature driven agile oriented web applications

Callbacks

• Used for Asynchronous Execution

Page 73: Feature driven agile oriented web applications

Closures

Page 74: Feature driven agile oriented web applications

Prototypes

Page 75: Feature driven agile oriented web applications

Inheritance

• Prototypal inheritance i.e there are no classes• Instead the focus is on objects• You start by making a useful object. You can

then make many more objects that are like that one.

• So once we have an object that we like, we can make more instances with the

Object.create() method

Page 76: Feature driven agile oriented web applications

Inheritance

Page 77: Feature driven agile oriented web applications

Features of JS Frameworks• DOM Element Selection• DOM Traversal & Modification• DOM manipulation• Events• Effects & Animations• AJAX• JSON Parsing• Extensibility• Utilities

Page 78: Feature driven agile oriented web applications

DOM Element Selection

• $(selector)• Selectors can be– ID– Class– Psuedo selectors

Page 79: Feature driven agile oriented web applications

DOM Traversal & Modification

• .each()• .find()• .filter()• .first()• .last()• .next()• .previous()

Page 80: Feature driven agile oriented web applications

DOM Manipulation

• .after()• .appendTo()• .attr()• .before()• .clone()• .css()• .empty()

Page 81: Feature driven agile oriented web applications

Events

• .bind()• .unbind()• .change()• .click()• .error()• .focus()• .keyup()

Page 82: Feature driven agile oriented web applications

Effects & Animations

• .animate()• .fadeIn()• .fadeTo()• .hide()• .show()• .slideUp()• .slideDown()

Page 83: Feature driven agile oriented web applications

AJAX

• URL• Settings– async– contentType– data– dataType– error– success

Page 84: Feature driven agile oriented web applications

AJAX

Page 85: Feature driven agile oriented web applications

JSON Parsing

Page 86: Feature driven agile oriented web applications

Extensibility

• jQuery supports easy creation of plugins to enhance the functionality and features provided by jQuery

Page 87: Feature driven agile oriented web applications

Utilities

• .browser()• .extend()• .inArray()• .isArray()• .isEmptyObject()• .isFunction()• .isNumeric()

Page 88: Feature driven agile oriented web applications

Recap• Understood why web development is

important• Defined a problem to delve deeper into this

field• Overview on Backend Development• Overview on Frontend Development• Web Debugging

Page 89: Feature driven agile oriented web applications

HTML5 APIs

• localStorage• Application Cache• GeoLocation

Page 90: Feature driven agile oriented web applications

localStorage

• Easy mechanism to store data within the browser

• More secure & faster than cookies• Data stored as key/value pairs• Data is domain specific

Page 91: Feature driven agile oriented web applications

Application Cache

Application cache gives three advantages• Offline browsing - users can use the

application when they're offline• Speed - cached resources load faster• Reduced server load - the browser will only

download updated/changed resources from the server

Page 92: Feature driven agile oriented web applications

Including Cache

Page 93: Feature driven agile oriented web applications

Manifest FileManifest file has 3 sections• CACHE MANIFEST - Files listed under this

header will be cached after they are downloaded for the first time

• NETWORK - Files listed under this header require a connection to the server, and will never be cached

• FALLBACK - Files listed under this header specifies fallback pages if a page is inaccessible

Page 94: Feature driven agile oriented web applications

Example Manifest File

Page 95: Feature driven agile oriented web applications

Geolocation

• The HTML5 Geolocation API is used to get the geographical position of a user.

• Since this can compromise user privacy, the position is not available unless the user approves it.

Page 96: Feature driven agile oriented web applications

Responsive Web Design(RWD) Motivations

• RWD is a web design approach aimed at crafting sites to provide an optimal viewing experience– easy reading and navigation – minimum of resizing, panning, and scrolling– across a wide range of devices (from mobile

phones to desktop computer monitors)

Page 97: Feature driven agile oriented web applications

RWD Approach

• The fluid grid concept (percentages over pixels)

• Flexible images• Media Queries

Page 98: Feature driven agile oriented web applications

Growth of Mobile

Page 99: Feature driven agile oriented web applications

RWD Frameworks

Page 100: Feature driven agile oriented web applications

Bootstrap File Structure

Page 101: Feature driven agile oriented web applications

Features

• Scaffolding• Base CSS• Components• Javascript Plugins

Page 102: Feature driven agile oriented web applications

CDN

• A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet.

• The goal of a CDN is to serve content to end-users with high availability and high performance.

Page 103: Feature driven agile oriented web applications

CloudFlare

Page 104: Feature driven agile oriented web applications

LINUX Overview

• Created by Linus Torvalds in 1991• Directory Structure• Access Control & User groups• Man Pages

Page 105: Feature driven agile oriented web applications

Directory Structure

Page 106: Feature driven agile oriented web applications

Access Control & User Groups

• Root User• User Directories• Admin Groups• Sudo

Page 107: Feature driven agile oriented web applications

Chmod

Page 108: Feature driven agile oriented web applications

Chown

• Changes ownership of the file or directory

Page 109: Feature driven agile oriented web applications

Chgrp

• Changes Group of the file or directory

Page 110: Feature driven agile oriented web applications

Man Pages

• Manual pages or help command provided by the OS

• Contains a synopsis of the command with relevant example

Page 111: Feature driven agile oriented web applications

Crons

Page 112: Feature driven agile oriented web applications

Crons

Page 113: Feature driven agile oriented web applications

Apache Configuration

• Start, Stop & Shutdown• Vhosts configuration• Mod Rewrite Configuration• Basics of .htaccess configuration

Page 114: Feature driven agile oriented web applications

Vhosts Configuration

Page 115: Feature driven agile oriented web applications

Mod Rewrite Configuration

Page 116: Feature driven agile oriented web applications

.htaccess

RewriteEngine onRewriteBase /deny from <ip address>

Page 117: Feature driven agile oriented web applications

MySQL

• RDBMS• Tables• Joins• Procedures• Views• Triggers

Page 118: Feature driven agile oriented web applications

Tools

• Netbeans• MySQL Workbench• Terminal• LESS.app• Chrome Web Inspector

Page 119: Feature driven agile oriented web applications

Testing

• Test Driven Development• Server side testing– PHP Unit

• Client side testing– Jasmine

Page 120: Feature driven agile oriented web applications

Version Control Motivations

• Enabling simultaneous work• Collaboration• Archiving every version• Easy to track changes

Page 121: Feature driven agile oriented web applications

History of version control

Page 122: Feature driven agile oriented web applications

Deployment

• PAAS vs IAAS• IAAS App Deployment• PAAS App Deployment• Heroku• 12 Factor App

Page 123: Feature driven agile oriented web applications

PAAS vs IAAS

Page 124: Feature driven agile oriented web applications

IAAS App Deployment

Page 125: Feature driven agile oriented web applications

PAAS App Deployment

Page 126: Feature driven agile oriented web applications

Heroku

• Heroku is a cloud platform as a service (PaaS) supporting several programming languages

• Heroku was acquired by Salesforce.com in 2010

• The base Operating System is Debian based Ubuntu(LINUX)

• Provides an easy to use platform for deploying applications

Page 127: Feature driven agile oriented web applications

12 Factor App

• Codebase• Dependencies• Config• Backing Services• Build, Release & Run• Processes• Port Binding• Concurrency

Page 128: Feature driven agile oriented web applications

12 Factor App

• Disposability• Dev/Prod Parity• Logs• Admin Processes

Page 129: Feature driven agile oriented web applications

Developer Workflow

Page 130: Feature driven agile oriented web applications

Development Process

Page 131: Feature driven agile oriented web applications

Continuous Integration• Maintain a code repository• Automate the build• Make the build self testing• Everyone commits to the baseline• Keep builds fast• Test in a clone environment• Make it easy to get latest deliverables• Everyone can see the results of the latest build• Automate Deployment

Page 132: Feature driven agile oriented web applications

Future Technologies• Linux – VMs(probably a stripped version of

LINUX)• Apache – End Point based programming• MySQL – NoSQL(MongoDB, Redis)• PHP – Node.js• jQuery – Angular, Backbone etc• SVN – Git• LESS – Don’t see a lot of change here• RWD more widely adopted

Page 133: Feature driven agile oriented web applications

Thank You