#7 - client-side web apps, mvc and jquery

29
Tecniche di animazione digitale 1

Upload: iloveigloo

Post on 15-Jan-2015

714 views

Category:

Technology


0 download

DESCRIPTION

- Client-side web apps - Architecture - MVC - jQuery

TRANSCRIPT

Page 1: #7 - Client-side web apps, MVC and jQuery

Tecniche di animazionedigitale 1

Page 2: #7 - Client-side web apps, MVC and jQuery

Michele BertoliFounder / Lead Software Engineer at Igloo

[email protected]

Tecniche di animazionedigitale 1

Page 3: #7 - Client-side web apps, MVC and jQuery

Client-side 2January 16, 2013

Page 4: #7 - Client-side web apps, MVC and jQuery

Agenda

Client-side web apps

Architecture

MVC

jQuery

5

10

17

26

Page 5: #7 - Client-side web apps, MVC and jQuery

Client-side web apps

Page 6: #7 - Client-side web apps, MVC and jQuery

Intrduction

Client-side refers to operations that are performed by the

client in a client–server relationship in a computer network.

6 Client-side 2 / Client-side web app

Page 7: #7 - Client-side web apps, MVC and jQuery

Intrduction

7 Client-side 2 / Client-side web apps

Page 8: #7 - Client-side web apps, MVC and jQuery

Goals

● Less time● Less bandwidth● Lesser security risk

8 Client-side 2 / Client-side web apps

Page 9: #7 - Client-side web apps, MVC and jQuery

Samples

● Facebook● Twitter● Gmail

9 Client-side 2 / Client-side web apps

Page 10: #7 - Client-side web apps, MVC and jQuery

Architecture

Page 11: #7 - Client-side web apps, MVC and jQuery

Intrduction

A single-page application (SPA), also known as single-page

interface (SPI), is a web application or web site that fits on a

single web page with the goal of providing a more fluid user

experience akin to a desktop application.

11 Client-side 2 / Architecture

Page 12: #7 - Client-side web apps, MVC and jQuery

Pros

● Single page load● New code/data on demand● No reloads

12 Client-side 2 / Architecture

Page 13: #7 - Client-side web apps, MVC and jQuery

Cons

● SEO● Browser history

13 Client-side 2 / Architecture

Page 14: #7 - Client-side web apps, MVC and jQuery

Events

Events are signals generated when specific actions occur.

JavaScript is aware of these signals, and scripts can be built to

react to these events.

14 Client-side 2 / Architecture

Page 15: #7 - Client-side web apps, MVC and jQuery

Samples

● blur occurs when input focus is removed from a form element (when the user clicks outside a field) or focus is removed from a window

● click occurs when the user clicks on a link or form element● change occurs when the value of a form field is changed by

the user● focus occurs when input focus is given to a form element

or a window

15 Client-side 2 / Architecture

Page 16: #7 - Client-side web apps, MVC and jQuery

Coffee Break

Page 17: #7 - Client-side web apps, MVC and jQuery

MVC

Page 18: #7 - Client-side web apps, MVC and jQuery

Introduction

A pattern is a reusable solution that can be applied to

commonly occurring problems in software design.

18 Client-side 2 / MVC

Page 19: #7 - Client-side web apps, MVC and jQuery

Goals

● Maintainable● Reusable

19 Client-side 2 / MVC

Page 20: #7 - Client-side web apps, MVC and jQuery

Introduction

Model–view–controller (MVC) is a software architecture that

separates the representation of information from the user's

interaction with it.

20 Client-side 2 / MVC

Page 21: #7 - Client-side web apps, MVC and jQuery

Architecture

21 Client-side 2 / MVC

Page 22: #7 - Client-side web apps, MVC and jQuery

Model

Model is where the application’s data objects are stored. The

model doesn’t know anything about views and controllers.

22 Client-side 2 / MVC

Page 23: #7 - Client-side web apps, MVC and jQuery

View

View is what's presented to the users and how users interact

with the app. The view is made with HTML, CSS, JavaScript and

templates.

23 Client-side 2 / MVC

Page 24: #7 - Client-side web apps, MVC and jQuery

Controller

The controller is the decision maker and the glue between the

model and view.

The controller updates the view when the model changes.

It also adds event listeners to the view and updates the model

when the user manipulates the view.

24 Client-side 2 / MVC

Page 25: #7 - Client-side web apps, MVC and jQuery

Frameworks

25 Client-side 2 / MVC

● Backbone● Angular● Knockout

http://backbonejs.orghttp://angularjs.orghttp://knockoutjs.com

Page 26: #7 - Client-side web apps, MVC and jQuery

jQuery

Page 27: #7 - Client-side web apps, MVC and jQuery

Introduction

A fast, concise, library that simplifies how to traverse HTML

documents, handle events, perform animations, and add AJAX.

27 Client-side 2 / jQuery

http://jquery.com

Page 28: #7 - Client-side web apps, MVC and jQuery

Why jQuery?

document.getElementsByTagName("div")[0].innerHTML = "Hello";

28 Client-side 2 / jQuery

$("div").first().html("Hello");

JavaScript

jQuery

Page 29: #7 - Client-side web apps, MVC and jQuery

Thank you