software development - the java perspective

39
Software Development = the Java perspective =

Upload: alinpandichi

Post on 12-Jul-2015

78 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Software development - the java perspective

Software Development= the Java perspective =

Page 2: Software development - the java perspective

Database

Storage

>GET SALES TOTAL

>GET SALES TOTAL

GET LIST OF ALL SALES MADE LAST YEAR

ADD ALL SALES TOGETHER

4 TOTAL SALES

QUERYSALE 1 SALE 2 SALE 3 SALE 4Data tier

Presentation tier

Logic tierThis layer coordinates the application, processes commands, makes logical decisions and evaluations, and performs calculations. It also moves and processes data between the two surrounding layers.

Here information is stored and retrieved from a database or file system. The information is then passed back to the logic tier for processing, and then eventually back to the user.

The top-most level of the application is the user interface. The main function of the interface is to translate tasks and results to something the user can understand.

Three-Tier Architecture

Page 3: Software development - the java perspective

Three-Tier Architecture

Page 4: Software development - the java perspective

The Presentation Tier

Page 5: Software development - the java perspective

<html><head>

...</head>

<body>...

</body></html>

Hyper-Text Markup Language

start tag

data related to the pageCSS, JS, page title, etc.

actual page content

end tag

Page 6: Software development - the java perspective

HTML 5 layouts

Page 8: Software development - the java perspective

#header { background-color:black; color:white; text-align:center; padding:5px;}

Cascading Style Sheets

Page 9: Software development - the java perspective

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_layout_divs

http://www.mezzoblue.com/zengarden/alldesigns/

http://www.csszengarden.com/217/

http://www.csszengarden.com/215/

CSS - Demo

Page 10: Software development - the java perspective

var sum = function() { var i, result = 0; for (i = 0; i < arguments.length; ++i) { x += arguments[i]; } return result;}

sum(1, 2, 3); // returns 6

JavaScript

Page 11: Software development - the java perspective

public int sumAll(int... numbers) { int result = 0; for(int i = 0 ; i<numbers.length;i++){ result+=numbers[i]; }

return result;}

sum(1, 2, 3); // returns 6

JavaScript is NOT Java

Page 12: Software development - the java perspective

JavaScript is NOT Java

JavaScript Java

Can Run in a Browser? Yes Yes, with applets (old technology)

Can Run on a Server? Yes (e.g. Node.js) Yes

Compiled? No, interpreted Yes, to bytecode

Threads Single-threaded Multi-threaded

Types Loose typing Strong typing

Characteristics Prototype-basedHigher-order functions

Classes

Page 13: Software development - the java perspective

JavaScript is NOT Java

Page 14: Software development - the java perspective

http://jsfiddle.net/w24pysbx/

JavaScript - Demo

Page 15: Software development - the java perspective

Database

Storage

>GET SALES TOTAL

>GET SALES TOTAL

GET LIST OF ALL SALES MADE LAST YEAR

ADD ALL SALES TOGETHER

4 TOTAL SALES

QUERYSALE 1 SALE 2 SALE 3 SALE 4Data tier

Presentation tier

Logic tierThis layer coordinates the application, processes commands, makes logical decisions and evaluations, and performs calculations. It also moves and processes data between the two surrounding layers.

Here information is stored and retrieved from a database or file system. The information is then passed back to the logic tier for processing, and then eventually back to the user.

The top-most level of the application is the user interface. The main function of the interface is to translate tasks and results to something the user can understand.

Presentation --> Logic

Page 16: Software development - the java perspective

A method of communication between two devices over a network.

Web Services (WS)

Page 17: Software development - the java perspective

A method of communication between two devices over a network.

Web Services (WS)

REST

● Exposes RESOURCES which represent DATA

● Uses HTTP verbs (GET / POST / DELETE)

● Simple point-to-point communication

● Multiple data formats (XML/JSON)

● Stateless communication

SOAP

● Exposes OPERATIONS which represent LOGIC

● Uses HTTP verb: POST● Loosly coupled distributed

messaging● Only XML● Supports stateless and stateful● Async messaging● Strong typing (WSDL)

Page 18: Software development - the java perspective

Data Formats

JSON{ "books": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95, "copies": 3 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99, "copies": 5 } ]}

XML

<books> <book> <category>reference</category> <author>Nigel Rees</author> <title>Sayings of the Century</title> <price>8.95</price> <copies>3</copies> </book> <book> <category>fiction</category> <author>Evelyn Waugh</author> <title>Sword of Honour</title> <price>12.99</price> <copies>5</copies> </book></books>

Page 19: Software development - the java perspective

SOAP

Request<soap12:Envelope

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

<soap12:Body> <GetWeather xmlns="http://www.webserviceX.NET"> <CityName>New York</CityName> <CountryName>United States</CountryName> </GetWeather> </soap12:Body>

</soap12:Envelope>

Page 20: Software development - the java perspective

SOAP

Response<soap12:Envelope

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

<soap12:Body> <GetWeatherResponse xmlns="http://www.webserviceX.NET"> <GetWeatherResult>

Wind from the NW (320 degrees) at 13 MPH Visibility 3 mile(s)SkyConditions overcastTemperature 39.9 F (4.4 C)

</GetWeatherResult> </GetWeatherResponse> </soap12:Body>

</soap12:Envelope>

Page 21: Software development - the java perspective

REST

RequestGET /globalweather.asmx/GetWeather?

CityName=NewYork&CountryName=United%20States HTTP/1.1 Host: www.webservicex.net

ResponseHTTP/1.1 200 OKContent-Type: text/xml; charset=utf-8Content-Length: length

<string xmlns="http://www.webserviceX.NET">Wind from the NW (320 degrees) at 13 MPH Visibility 3 mile(s)SkyConditions overcastTemperature 39.9 F (4.4 C)

</string>

Page 22: Software development - the java perspective

SOAP and REST

Page 23: Software development - the java perspective

A web server serves up static resources (HTML, CSS, JS, text, images, etc.)

and nothing else.

A servlet container is using Java to dynamically generate the web page on

the server side.

An application server supports the entireJava Enterprise Edition stack

(JEE, formerly known as J2EE)

App Servers

Page 24: Software development - the java perspective

A web server serves up static resources (HTML, CSS, JS, text, images, etc.)

and nothing else.

App Servers

Page 25: Software development - the java perspective

A servlet container is using Java to dynamically generate the web page on

the server side.

App Servers

Page 26: Software development - the java perspective

An application server supports the entireJava Enterprise Edition stack

(JEE, formerly known as J2EE)

App Servers

Page 27: Software development - the java perspective

Database Management Systems is an umbrella term that refers to the systems that handle, or heavily assist in handling, dealing with collections of information that need to be persisted.

DBMS are based on database models, structures defined for handling the data:● The Relational Model● The Model-less, Schema-less (NoSQL) Approach

Popular DBMS:● Relational (RDBMS)● NoSQL (NewSQL)

Databases

Page 28: Software development - the java perspective

Relational (RDBMS)

Page 29: Software development - the java perspective

Relational (RDBMS)

Page 30: Software development - the java perspective

Database Management Systems is an umbrella term that refers to the systems that handle, or heavily assist in handling, dealing with collections of information that need to be persisted.

DBMS are based on database models, structures defined for handling the data:● The Relational Model● The Model-less, Schema-less (NoSQL) Approach

Popular DBMS:● Relational (RDBMS)● NoSQL (NewSQL)

Databases

Page 31: Software development - the java perspective

Relational (RDBMS)

Page 32: Software development - the java perspective

NoSQL databases

Schema-less databases do not come with a model as used (or needed) with structured relational solutions.

●Key-values Stores●Column Family Stores●Document Databases●Graph Databases

Page 33: Software development - the java perspective

NoSQL databases

Key-values Stores: Using a hash table where there is a unique key and a pointer to a particular item of data.

Page 34: Software development - the java perspective

NoSQL databases

Column Family Stores: There are still keys but they point to multiple columns. The columns are arranged by column family.

Page 35: Software development - the java perspective

NoSQL databases

Document Databases: The model is basically versioned documents that are collections of other key-value collections. The semi-structured documents are stored in formats like JSON.

Page 36: Software development - the java perspective

NoSQL databases

Graph Databases: Instead of tables of rows and columns and the rigid structure of SQL, a flexible graph model is used.

Page 37: Software development - the java perspective

NoSQL databases

Term Matching Databases

Key-value

Memcache, Redis, Riak, Dynamo, FoundationDB, Aerospike, FairCom c-treeACE

DocumentMongoDB, CouchDB, Couchbase, MarkLogic Clusterpoint,

Column Cassandra, Accumulo, Hbase, Druid, Vertica

GraphNeo4J, InfiniteGraph, OrientDB, Allegro, Virtuoso, Stardog

Page 38: Software development - the java perspective

History of NoSQL

Page 39: Software development - the java perspective

HTML + CSS + JSREST API

Java application serverMySQL database server

Demo