Software Development 
= the Java perspective =
Three-Tier Architecture 
Database 
4 TOTAL SALES 
Storage 
>GET SALES 
TOTAL 
>GET SALES 
TOTAL 
GET LIST OF ALL 
SALES MADE 
LAST YEAR 
ADD ALL SALES 
TOGETHER 
QUERY 
SALE 1 
SALE 2 
SALE 3 
Presentation tier 
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. 
Logic tier 
This 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. 
Data tier SALE 4 
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.
Three-Tier Architecture
The Presentation Tier
<html> 
<head> 
... 
</head> 
<body> 
... 
</body> 
</html> 
Hyper-Text Markup Language 
start tag 
data related to the page 
CSS, JS, page title, etc. 
actual page content 
end tag
HTML 5 layouts
HTML - Demo 
http://www.w3schools.com/html/tryit.asp 
?filename=tryhtml_layout_divs
Cascading Style Sheets 
#header { 
background-color:black; 
color:white; 
text-align:center; 
padding:5px; 
}
CSS - Demo 
http://www.w3schools.com/html/tryit.asp 
?filename=tryhtml_layout_divs 
http://www.mezzoblue.com/zengarden/all 
designs/ 
http://www.csszengarden.com/217/ 
http://www.csszengarden.com/215/
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
JavaScript is NOT Java 
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 
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-based 
Higher-order functions 
Classes
JavaScript is NOT Java
JavaScript - Demo 
http://jsfiddle.net/w24pysbx/
Presentation --> Logic 
Database 
4 TOTAL SALES 
Storage 
>GET SALES 
TOTAL 
>GET SALES 
TOTAL 
GET LIST OF ALL 
SALES MADE 
LAST YEAR 
ADD ALL SALES 
TOGETHER 
QUERY 
SALE 1 
SALE 2 
SALE 3 
Presentation tier 
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. 
Logic tier 
This 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. 
Data tier SALE 4 
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.
Web Services (WS) 
A method of communication between two 
devices over a network.
Web Services (WS) 
A method of communication between two 
devices over a network. 
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)
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>
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>
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 overcast 
Temperature 39.9 F (4.4 C) 
</GetWeatherResult> 
</GetWeatherResponse> 
</soap12:Body> 
</soap12:Envelope>
REST 
Request 
GET /globalweather.asmx/GetWeather? 
CityName=NewYork&CountryName=United%20States HTTP/1.1 
Host: www.webservicex.net 
Response 
HTTP/1.1 200 OK 
Content-Type: text/xml; charset=utf-8 
Content-Length: length 
<string xmlns="http://www.webserviceX.NET"> 
Wind from the NW (320 degrees) at 13 MPH 
Visibility 3 mile(s) 
SkyConditions overcast 
Temperature 39.9 F (4.4 C) 
</string>
SOAP and REST
App Servers 
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 entire 
Java Enterprise Edition stack 
(JEE, formerly known as J2EE)
App Servers 
A web server serves up static resources 
(HTML, CSS, JS, text, images, etc.) 
and nothing else.
App Servers 
A servlet container is using Java to 
dynamically generate the web page on 
the server side.
App Servers 
An application server supports the entire 
Java Enterprise Edition stack 
(JEE, formerly known as J2EE)
Databases 
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)
Relational (RDBMS)
Relational (RDBMS)
Databases 
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)
Relational (RDBMS)
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
NoSQL databases 
Key-values Stores: Using a hash table where there is 
a unique key and a pointer to a particular item of data.
NoSQL databases 
Column Family Stores: There are still keys but they 
point to multiple columns. The columns are arranged 
by column family.
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.
NoSQL databases 
Graph Databases: Instead of tables of rows and 
columns and the rigid structure of SQL, a flexible 
graph model is used.
NoSQL databases 
Term Matching Databases 
Key-value 
Memcache, Redis, Riak, 
Dynamo, FoundationDB, 
Aerospike, FairCom c-treeACE 
Document 
MongoDB, CouchDB, 
Couchbase, MarkLogic 
Clusterpoint, 
Column Cassandra, Accumulo, 
Hbase, Druid, Vertica 
Graph 
Neo4J, InfiniteGraph, 
OrientDB, Allegro, 
Virtuoso, Stardog
History of NoSQL
Demo 
HTML + CSS + JS 
REST API 
Java application server 
MySQL database server

Software development - the java perspective

  • 1.
    Software Development =the Java perspective =
  • 2.
    Three-Tier Architecture Database 4 TOTAL SALES Storage >GET SALES TOTAL >GET SALES TOTAL GET LIST OF ALL SALES MADE LAST YEAR ADD ALL SALES TOGETHER QUERY SALE 1 SALE 2 SALE 3 Presentation tier 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. Logic tier This 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. Data tier SALE 4 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.
  • 3.
  • 4.
  • 5.
    <html> <head> ... </head> <body> ... </body> </html> Hyper-Text Markup Language start tag data related to the page CSS, JS, page title, etc. actual page content end tag
  • 6.
  • 7.
    HTML - Demo http://www.w3schools.com/html/tryit.asp ?filename=tryhtml_layout_divs
  • 8.
    Cascading Style Sheets #header { background-color:black; color:white; text-align:center; padding:5px; }
  • 9.
    CSS - Demo http://www.w3schools.com/html/tryit.asp ?filename=tryhtml_layout_divs http://www.mezzoblue.com/zengarden/all designs/ http://www.csszengarden.com/217/ http://www.csszengarden.com/215/
  • 10.
    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
  • 11.
    JavaScript is NOTJava 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
  • 12.
    JavaScript is NOTJava 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-based Higher-order functions Classes
  • 13.
  • 14.
    JavaScript - Demo http://jsfiddle.net/w24pysbx/
  • 15.
    Presentation --> Logic Database 4 TOTAL SALES Storage >GET SALES TOTAL >GET SALES TOTAL GET LIST OF ALL SALES MADE LAST YEAR ADD ALL SALES TOGETHER QUERY SALE 1 SALE 2 SALE 3 Presentation tier 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. Logic tier This 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. Data tier SALE 4 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.
  • 16.
    Web Services (WS) A method of communication between two devices over a network.
  • 17.
    Web Services (WS) A method of communication between two devices over a network. 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)
  • 18.
    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>
  • 19.
    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>
  • 20.
    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 overcast Temperature 39.9 F (4.4 C) </GetWeatherResult> </GetWeatherResponse> </soap12:Body> </soap12:Envelope>
  • 21.
    REST Request GET/globalweather.asmx/GetWeather? CityName=NewYork&CountryName=United%20States HTTP/1.1 Host: www.webservicex.net Response HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <string xmlns="http://www.webserviceX.NET"> Wind from the NW (320 degrees) at 13 MPH Visibility 3 mile(s) SkyConditions overcast Temperature 39.9 F (4.4 C) </string>
  • 22.
  • 23.
    App Servers Aweb 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 entire Java Enterprise Edition stack (JEE, formerly known as J2EE)
  • 24.
    App Servers Aweb server serves up static resources (HTML, CSS, JS, text, images, etc.) and nothing else.
  • 25.
    App Servers Aservlet container is using Java to dynamically generate the web page on the server side.
  • 26.
    App Servers Anapplication server supports the entire Java Enterprise Edition stack (JEE, formerly known as J2EE)
  • 27.
    Databases Database ManagementSystems 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)
  • 28.
  • 29.
  • 30.
    Databases Database ManagementSystems 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)
  • 31.
  • 32.
    NoSQL databases Schema-lessdatabases do not come with a model as used (or needed) with structured relational solutions. ●Key-values Stores ●Column Family Stores ●Document Databases ●Graph Databases
  • 33.
    NoSQL databases Key-valuesStores: Using a hash table where there is a unique key and a pointer to a particular item of data.
  • 34.
    NoSQL databases ColumnFamily Stores: There are still keys but they point to multiple columns. The columns are arranged by column family.
  • 35.
    NoSQL databases DocumentDatabases: The model is basically versioned documents that are collections of other key-value collections. The semi-structured documents are stored in formats like JSON.
  • 36.
    NoSQL databases GraphDatabases: Instead of tables of rows and columns and the rigid structure of SQL, a flexible graph model is used.
  • 37.
    NoSQL databases TermMatching Databases Key-value Memcache, Redis, Riak, Dynamo, FoundationDB, Aerospike, FairCom c-treeACE Document MongoDB, CouchDB, Couchbase, MarkLogic Clusterpoint, Column Cassandra, Accumulo, Hbase, Druid, Vertica Graph Neo4J, InfiniteGraph, OrientDB, Allegro, Virtuoso, Stardog
  • 38.
  • 39.
    Demo HTML +CSS + JS REST API Java application server MySQL database server