Top Banner
BEST PRACTICES FOR PRODUCING TODAY’S WEB APPLICATIONS. BY BRETT MILLETT HTTP://SLIDESHA.RE/WEBSUU Web Development Today!
23

Web Development Today

Sep 12, 2014

Download

Technology

A look today's Web Application.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Web Development Today

BEST PRACTICES FOR PRODUCING TODAY’S WEB APPLICATIONS.

BYBRETT MILLETT

H TT P : / / S L I D E S H A . R E / W E B S U U

Web Development Today!

Page 2: Web Development Today

What is a Web Application?

A Web Application is a collection of several separate, but integrated technologies. A Web Application typically has scripting on both the client and server “sides.” Web applications typically have many layers.

Server-side Web Server (HTTP Protocol)

Apache Nginx IIS

Programming Interface (Various computer languages) PHP Ruby Python

Database MySQL Postgres Couch DB

Client-side Web Browser JavaScript

AJAX Cascading Style Sheets (CSS)

Page 3: Web Development Today

What is a Web Application?

Page 4: Web Development Today

Server-side Components

Which components do you choose?Factors include:

Operating System Linux or Microsoft?

OS most often determines Web Server Linux: Apache (most common, but there are others) Windows: IIS

Web Server often determines Database & Language IIS: Microsoft SQL Server & ASP.NET Apache: MySQL & PHP (most common)

Many other alternatives!

Page 5: Web Development Today

Client-side Components

Which components do you choose?Not so many choices.You must support all browsers but they

typically follow standards (C’mon IE!)Cascading Styles are pretty standard (new

CSS3 spec is pretty useful)JavaScript frameworks are all the rage.

JQuery Protocol MooTools

Page 6: Web Development Today

Server-side Components

Which do I typically choose? LAMP. Linux as OS Apache for Web Service MySQL for database PHP for programming language

LAMP is an acronym for a solution stack. Server-side technologies to provide a Web application.

Probably the most common solution stack for Web Development.

Page 7: Web Development Today

Advantages to the LAMP stack

The LAMP stack is widely used because it offers a great number of advantages for developers: Easy to code: Novices can build something and get it up and

running very quickly with PHP and MySQL. Easy to deploy: Since PHP is a standard Apache module, it is

easy to deploy LAMP web applications by uploading .php files to an Apache server and connecting to a MySQL database.

Develop locally: LAMP can be set up so an app can be built locally, then deployed to the Web.

Cheap and ubiquitous hosting: Many inexpensive web hosts provide PHP and MySQL services.

None of the above reasons mean it’s always the best solution stack!

Page 8: Web Development Today

Server-side Best Practices

The Model, View, Controller paradigm Greatest thing since sliced bread…for Web developers

anyway!Web server is abstracted away from this

approach. Any Web Server can be used. It’s a developer thing. If you’re a designer

you may only ever deal with the View side of MVC

So…why is it so great again…?

Page 9: Web Development Today

MVC: Designer Advantages

Clean HTML templates.No need to understand complex

programming in a dynamic Web Application.A Website may be completely changed in

terms of design and overall layout without requiring a programmer!

Page 10: Web Development Today

MVC: Designer Advantages

Page 11: Web Development Today

MVC: Programmer Advantages

“Pretty” SEO-friendly URLs.Keep business logic separate from layout!Modularity. Models can be reused.Same code can be applied to numerous

formats Standard and mobile versions of website. Feed formats like Atom or RSS Data formats like XML or JSON

Designers can’t mess up your code! ;-)

Page 12: Web Development Today

MVC: Model View Controller

Page 13: Web Development Today

MVC: The Controller

Routing Determines which controller is called via URL. Example: http://your-web-site.com/controller/home

Controls flow of the Web application.Convention over configuration.

Application entry point: URL Routing (configuration) “Friendly” URL’s

Requests data from Models.Passes data to Views.“Thin controllers, fat models…”

Controllers “know” little about data. Concerned only with aggregating data and passing it to view layer.

Page 14: Web Development Today

MVC: The Model

Creates and returns application data XML PHP arrays Database Object JSON

Business logic relating to application data.Returns data to Controller on request.

Page 15: Web Development Today

MVC: The View

User Interface HTML RSS JSON

Accepts data from ControllerLogic Concerned with layout only

Looping structures to present data (foreach, for, while)Templates

Special markup tags: Smarty:

Name: {$name}<br>Address: {$address}<br>

PHP: Name: <?=$name?><br>

Address: <?=$address?><br>

Page 16: Web Development Today

Popular MVC Frameworks

PHP Zend Framework Symfony Cake CodeIgniter

Python Django

Perl Catalyst

Ruby Ruby on Rails

Java Struts

.NET ASP.NET MVC Framework

Page 17: Web Development Today

Client-side Best Practices

Use the least amount of HTML as possible.Rely on CSS for layout.Unobtrusive JavaScript.Implement AJAX after non-script functionality

is assured.

Page 18: Web Development Today

Client-side Best Practices

Use the least amount of HTML as possible. Do not rely on WYSIWYG Editors (Dreamweaver.) Do not Use HTML tag attributes for layout purposes.

Only for meta data.

Page 19: Web Development Today

Client-side Best Practices

Rely on CSS for layout. CSS is yet another abstraction that separates your

design elements from your content. Makes your webpage yummy for Search Engines

(search engines prefer vitamin supplements over Seven Layer Dip!)

Page 20: Web Development Today

Client-side Best Practices

Unobtrusive JavaScript. Use a JavaScript framework

JQuery Prototype

“Latch onto” DOM elements and apply events (English for non-programmers, “onclick in your tag is so 2001!”)

Create your HTML layout as if JavaScript wasn’t an option.

After your website is functional without JavaScript, come back and add JavaScript functionality.

Page 21: Web Development Today

Client-side Best Practices

Implement AJAX after non-script functionality is assured. Short for Asynchronous JavaScript and XML. Create your HTML forms as if AJAX wasn’t an option. After your website is functional without AJAX, come

back and add AJAX functionality. JQuery’s (or Prototype’s) selector syntax is perfect for

overriding typical form functionality.

Page 22: Web Development Today

The Life and Death of Design

Page 23: Web Development Today

Questions & Answers

Brett MillettSlides:

http://slidesha.re/websuu/Twitter (pretty boring really):

http://www.twitter.com/brettm73/ My Website:

http://www.brettic.us/

Thank You!