SlideShare une entreprise Scribd logo
1  sur  66
Java & Java pla(orms
Ilio Catallo - info@iliocatallo.it
Outline
• Java technology
• JEE applica2ons
• References
Java technology
Java technology
Java is both a programming language and a pla-orm
The Java programming language
The Java programming language is a high-level, object-oriented
programming language firstly released in 1995
class App {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Pla$orms
A pla$orm is the hardware and so.ware environment in which a
program runs
Java pla'orms
A Java pla'orm is a par(cular environment in which Java
applica(ons run
Pla$orms
Pla$orms usually consist of a combina2on of the opera&ng system
and the underlying hardware
Pla$orms
Example: Microso) Windows on Intel architecture
Java pla'orm
The Java pla*orm is a so#ware-only pla*orm that runs on top of
other pla*orms
┌───────────────────────────────────┐
│ Java program │
├───────────────────────────────────┤
│ Java platform │
├───────────────────────────────────┤
│ Host platform │
└───────────────────────────────────┘
Java pla'orm
Every Java pla+orm consists of:
• A Java Virtual Machine (JVM)
• A set of applica8on programming interfaces (APIs)
Java virtual machine
The Java Virtual Machine (JVM) is an abstract computer that runs
compiled Java programs
┌───────────────────────────────────┐
│ Java program │
├─────────┬─────────────────────────┤
│ API │ │
├─────────┘ Java VM │
│ │
├───────────────────────────────────┤
│ Host platform │
└───────────────────────────────────┘
Java virtual machine
The JVM is virtual because it is implemented in so7ware on top of
a real host pla:orm
┌───────────────────────────────────┐
│ Java program │
├─────────┬─────────────────────────┤
│ API │ │
├─────────┘ Java VM │
│ │
├───────────────────────────────────┤
│ Host platform │
└───────────────────────────────────┘
Java virtual machine
Java programs are compiled into Java bytecode
Java virtual machine
Java bytecode is the machine language of the JVM
Java API
The Java API is a large collec2on of ready-made so9ware
components
Java API
It is grouped into libraries (packages) of related classes and
interfaces
Java API
For instance, the Collec0on API (java.util) provides the most
commonly used data structures
Java pla'orm specifica0ons
There exist three Java pla/orm specifica4ons
• Java Standard Edi-on
• Java Enterprise Edi-on
• Java Micro Edi-on
Java pla'orm specifica0ons
There exist three Java pla/orm specifica4ons
• Java Standard Edi,on
• Java Enterprise Edi,on
• Java Micro Edi-on
Java Standard Edi,on
Java Standard Edi,on (JSE) is a pla,orm specifica3on for
developing desktop applica,ons
Java Standard Edi,on
Java Standard Edi,on is the founda,on for developing in the Java
language, as it contains the set of Java standard libraries
Java Standard Edi,on
Java Standard Edi,on is just a specifica(on, not an implementa,on
Java Standard Edi,on
Vendors and open source projects are free to provide their own
implementa6on
• Oracle JDK
• OpenJDK
Java Enterprise Edi.on
Java Enterprise Edi.on (JEE) provides APIs and the run6me
environment for developing enterprise applica.ons
Java Enterprise Edi.on
Typical features of an enterprise applica1on
• Large-scale
• Distributed
• Highly-available
Java Enterprise Edi.on
Java Enterprise Edi.on is a superset of Java Standard Edi.on
Java Enterprise Edi.on
Therefore, JSE APIs can be used in any JEE applica:on
Java Enterprise Edi.on
JEE extends the JSE pla/orm with addi$onal APIs:
• Java Servlet API (javax.servlet)
• JavaServer Pages API (javax.servlet)
• Java Persistence API (java.persistence)
• Enterprise JavaBeans API (javax.ejb)
JEE specifica+on
Java Enterprise Edi.on is just a specifica(on, not an
implementa.on
JEE specifica+on
Namely, JEE is an umbrella specifica.on that references a number
of other more detailed specifica9on
┌──────────────────────────────────────────────┐
│ ┌──────────────┐ │
│ │ EJB │ │
│ ┌─────────────┐ │Specification │ │
│ │ Servlet │ └──────────────┘ │
│ │Specification│ │
│ └─────────────┘ ┌─────────────┐ │
│ │ JPA │ │
│ ┌─────────────┐ │Specification│ │
│ │ JSP │ └─────────────┘ │
│ │Specification│ │
│ └─────────────┘ │
└──────────────────────────────────────────────┘
JEE specification
JEE implementa,ons
Vendors and open source projects are free to implement one or
more JEE APIs
┌──────────────────────────────────────────────┐
│ ┌──────────────┐ │
│ │ EJB │ │
│ ┌─────────────┐ │Specification │ │
│ │ Servlet │ └──────────────┘ │
│ │Specification│ │
│ └─────────────┘ ┌─────────────┐ │
│ │ JPA │ │
│ ┌─────────────┐ │Specification│ │
│ │ JSP │ └─────────────┘ │
│ │Specification│ │
│ └─────────────┘ │
└──────────────────────────────────────────────┘
JEE specification
JEE implementa,ons
"Apache Tomcat 8.0 implements the Servlet 3.1 and JavaServer Pages
2.3 specifica?ons"
(Apache Tomcat 8.0 documenta3on)
JEE implementa,ons
"In addi(on to its own "na(ve" API, Hibernate is also an
implementa(on of the Java Persistence API (JPA) specifica(on"
(Hibernate ORM)
JEE Applica*ons
JEE Components
Java EE applica*ons are made up of components
JEE Components
A JEE component is a self-contained so/ware unit
JEE Components
You may already know a par0cular JEE component: servlets
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response);
public void doPost(HttpServletRequest request,
HttpServletResponse response);
public void init();
public void destroy();
}
JEE Components
There exist different types of JEE components
• Web components
• Business components
• Applica3on client components
JEE Components
Web components:
• Servlets
• JavaServer Pages (JSP) and JavaServer Faces (JSF)
JEE Components
Business components:
• Enterprise JavaBeans
JEE Components
Applica'on client components:
• Applets
• Applica+on Clients
JEE Containers
JEE components live within a container. A container is the JEE
run6me environment
JEE Containers
A container provides certain services to the components it hosts,
such as:
• Life-cycle management
• Dependency injec4on
• Concurrency
JEE Containers
Different kinds of components live in different kinds of containers
JEE servers
A Java EE server (also called applica&on server) implements the
en6re set of JEE APIs and provides the standard JEE containers
JEE servers
The reference JEE server is Oracle Glassfish. Possible alterna8ve
implementa8ons:
• IBM WebSphere
• Apache TomEE
• Red Hat JBoss
JEE servers
JEE server
┌────────────────────────────────────────────────────┐
│ Web container EJB container │
│ ┌──────────────────────┐ ┌─────────────────────┐ │
│ │ ┌─────────────┐ │ │ ┌─────────────┐ │ │
│ │ │ Servlet A │ │ │ │ EJB D │ │ │
│ │ └─────────────┘ │ │ └─────────────┘ │ │ ┌──────┐
┌─────────┐ │ │ ┌──────────┐│ │ ┌──────────┐│ │ │ │
│ Browser ├───┼─┤ │ JSP C │├───┤ │ EJB E │├─┼───┤ DB │
└─────────┘ │ │ └──────────┘│ │ └──────────┘│ │ │ │
│ │┌─────────────┐ │ │┌─────────────┐ │ │ └──────┘
│ ││ Servlet B │ │ ││ EJB F │ │ │
│ │└─────────────┘ │ │└─────────────┘ │ │
│ └──────────────────────┘ └─────────────────────┘ │
└────────────────────────────────────────────────────┘
Business logic
At the heart of any applica0on lies its business logic
"We call business logic any program code that pertains to the purpose
of a so6ware applica8on"
Business logic
In a chess game, the business logic handles:
• The board and pieces
• Their movements
• The rules of the game
Business logic
Such concerns are independent of, e.g., how pieces will be
displayed
Business logic
Such concerns are independent of, e.g., how pieces will be
displayed
The role of EJBs
In a JEE applica+on, EJBs encapsulate the business logic
@Stateless
public class FlightServiceBean {
List<SpecialDeal> getSpecialDeals() { ... }
List<Flight> findFlights(String queryString) { ... }
}
The role of EJBs
Moreover, the EJB container provides fundamental services such as
security and transac+ons
@Stateless
@TransactionManagement(TransactionManagementType.CONTAINER)
public class FlightServiceBean {
List<SpecialDeal> getSpecialDeals() { ... }
List<Flight> findFlights(String queryString) { ... }
}
The role of EJBs
Thanks to this, developers are free to focus of defining and
implemen6ng the business logic
JEE stack
However, many vendors and open source projects implement only
a subset of the JEE specifica;on
JEE stack
For instance, Apache Tomcat provides only a Web container
Web container
Web server
┌──────────────────────────┐
│ │
│ Web container │
│ ┌──────────────────────┐ │
│ │ ┌─────────────┐ │ │
│ │ │ Servlet A │ │ │
│ │ └─────────────┘ │ │ ┌──────┐
┌─────────┐ │ │ ┌──────────┐│ │ │ │
│ Browser ├───┼─┤ │ JSP C │├─┼───┤ DB │
└─────────┘ │ │ └──────────┘│ │ │ │
│ │┌─────────────┐ │ │ └──────┘
│ ││ Servlet B │ │ │
│ │└─────────────┘ │ │
│ └──────────────────────┘ │
│ │
└──────────────────────────┘
Can we built enterprise applica0ons without the whole JEE stack?
Can we write enterprise applica.on without the need of an applica.on
server?
The Spring Framework
The solu)on comes in the form of the Spring framework
The Spring Framework
…but this is something we will inves1gate in the next lecture ;-)
References
References
• Antonio Goncalves, Beginning Java EE 7, Apress Publica:ons
• Chris Richardson, POJOs in Ac:on, Manning Publica:ons
• D, Panda, R. Rahman, D. Lane, EJB3 In Ac:on, Manning
Publica:ons
• Oracle, GeGng Started
References
• Bill Venners, The lean, mean, virtual machine
• Oracle, Java EE 7 Tutorial
• Wikipedia, Java EE

Contenu connexe

Tendances

Tendances (20)

Java OOPS Concept
Java OOPS ConceptJava OOPS Concept
Java OOPS Concept
 
Fol
FolFol
Fol
 
Java package
Java packageJava package
Java package
 
javathreads
javathreadsjavathreads
javathreads
 
Exception handling in java
Exception handling  in javaException handling  in java
Exception handling in java
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
constructors in java ppt
constructors in java pptconstructors in java ppt
constructors in java ppt
 
Lecture 7 arrays
Lecture   7 arraysLecture   7 arrays
Lecture 7 arrays
 
Java Exception Handling and Applets
Java Exception Handling and AppletsJava Exception Handling and Applets
Java Exception Handling and Applets
 
this keyword in Java.pptx
this keyword in Java.pptxthis keyword in Java.pptx
this keyword in Java.pptx
 
Java packages
Java packagesJava packages
Java packages
 
Programming in Java
Programming in JavaProgramming in Java
Programming in Java
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
Java applet - java
Java applet - javaJava applet - java
Java applet - java
 
Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptx
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Java Notes
Java NotesJava Notes
Java Notes
 

En vedette

Apresentação java
Apresentação javaApresentação java
Apresentação java
munosai
 

En vedette (20)

Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
 
Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applicat...
Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applicat...Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applicat...
Java Platform and IDE Netbeans 6.7 for Developing Enterprise and Web Applicat...
 
La tua europa
La tua europaLa tua europa
La tua europa
 
INGENIERIA GEOGRAFICA Y AMBIENTAL
INGENIERIA GEOGRAFICA Y AMBIENTALINGENIERIA GEOGRAFICA Y AMBIENTAL
INGENIERIA GEOGRAFICA Y AMBIENTAL
 
El Hombre Y Su Comunidad (M.I)
El Hombre Y Su Comunidad  (M.I)El Hombre Y Su Comunidad  (M.I)
El Hombre Y Su Comunidad (M.I)
 
Mercurial Quick Tutorial
Mercurial Quick TutorialMercurial Quick Tutorial
Mercurial Quick Tutorial
 
12 SQL
12 SQL12 SQL
12 SQL
 
Growing a Data Pipeline for Analytics
Growing a Data Pipeline for AnalyticsGrowing a Data Pipeline for Analytics
Growing a Data Pipeline for Analytics
 
Desafío no. 32
Desafío no. 32Desafío no. 32
Desafío no. 32
 
Managing the Maturity of Tourism Destinations: the Challenge of Governance an...
Managing the Maturity of Tourism Destinations: the Challenge of Governance an...Managing the Maturity of Tourism Destinations: the Challenge of Governance an...
Managing the Maturity of Tourism Destinations: the Challenge of Governance an...
 
EVALUACION EDUCACION FISICA
EVALUACION EDUCACION FISICAEVALUACION EDUCACION FISICA
EVALUACION EDUCACION FISICA
 
Kti efta mayasari
Kti efta mayasariKti efta mayasari
Kti efta mayasari
 
CPP Language Basics - Reference
CPP Language Basics - ReferenceCPP Language Basics - Reference
CPP Language Basics - Reference
 
Understanding and using while in c++
Understanding and using while in c++Understanding and using while in c++
Understanding and using while in c++
 
Evaluacion escala de rango 2016 2017
Evaluacion escala de rango 2016 2017Evaluacion escala de rango 2016 2017
Evaluacion escala de rango 2016 2017
 
C++ basics
C++ basicsC++ basics
C++ basics
 
Grade 10 flowcharting
Grade 10  flowchartingGrade 10  flowcharting
Grade 10 flowcharting
 
ch 3
ch 3ch 3
ch 3
 
Apresentação java
Apresentação javaApresentação java
Apresentação java
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 

Similaire à Java and Java platforms

Java chapter 1 basic introduction Unit-1.pptx
Java chapter  1 basic introduction Unit-1.pptxJava chapter  1 basic introduction Unit-1.pptx
Java chapter 1 basic introduction Unit-1.pptx
noosdysharma
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
Nexus
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)
Barm Bannasan
 

Similaire à Java and Java platforms (20)

J introtojava1-pdf
J introtojava1-pdfJ introtojava1-pdf
J introtojava1-pdf
 
java intro.pptx
java intro.pptxjava intro.pptx
java intro.pptx
 
Introduction to java programming tutorial
Introduction to java programming   tutorialIntroduction to java programming   tutorial
Introduction to java programming tutorial
 
Java chapter 1 basic introduction Unit-1.pptx
Java chapter  1 basic introduction Unit-1.pptxJava chapter  1 basic introduction Unit-1.pptx
Java chapter 1 basic introduction Unit-1.pptx
 
What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)
 
What is-java
What is-javaWhat is-java
What is-java
 
Java introduction
Java introductionJava introduction
Java introduction
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Java programming basics notes for beginners(java programming tutorials)
Java programming basics notes for beginners(java programming tutorials)Java programming basics notes for beginners(java programming tutorials)
Java programming basics notes for beginners(java programming tutorials)
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Java introduction
Java introductionJava introduction
Java introduction
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java Cloud and Container Ready
Java Cloud and Container ReadyJava Cloud and Container Ready
Java Cloud and Container Ready
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)
 
Java -lec-1
Java -lec-1Java -lec-1
Java -lec-1
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
 
Core Java Basics
Core Java BasicsCore Java Basics
Core Java Basics
 
Java - At a glance
Java - At a glanceJava - At a glance
Java - At a glance
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)
 

Plus de Ilio Catallo

Plus de Ilio Catallo (20)

C++ Standard Template Library
C++ Standard Template LibraryC++ Standard Template Library
C++ Standard Template Library
 
Regular types in C++
Regular types in C++Regular types in C++
Regular types in C++
 
Resource wrappers in C++
Resource wrappers in C++Resource wrappers in C++
Resource wrappers in C++
 
Memory management in C++
Memory management in C++Memory management in C++
Memory management in C++
 
Operator overloading in C++
Operator overloading in C++Operator overloading in C++
Operator overloading in C++
 
Multidimensional arrays in C++
Multidimensional arrays in C++Multidimensional arrays in C++
Multidimensional arrays in C++
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Pointers & References in C++
Pointers & References in C++Pointers & References in C++
Pointers & References in C++
 
Spring MVC - Wiring the different layers
Spring MVC -  Wiring the different layersSpring MVC -  Wiring the different layers
Spring MVC - Wiring the different layers
 
Spring MVC - Web Forms
Spring MVC  - Web FormsSpring MVC  - Web Forms
Spring MVC - Web Forms
 
Spring MVC - The Basics
Spring MVC -  The BasicsSpring MVC -  The Basics
Spring MVC - The Basics
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
Introduction To Spring
Introduction To SpringIntroduction To Spring
Introduction To Spring
 
Gestione della memoria in C++
Gestione della memoria in C++Gestione della memoria in C++
Gestione della memoria in C++
 
Array in C++
Array in C++Array in C++
Array in C++
 
Puntatori e Riferimenti
Puntatori e RiferimentiPuntatori e Riferimenti
Puntatori e Riferimenti
 
Java Persistence API
Java Persistence APIJava Persistence API
Java Persistence API
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
 
Internationalization in Jakarta Struts 1.3
Internationalization in Jakarta Struts 1.3Internationalization in Jakarta Struts 1.3
Internationalization in Jakarta Struts 1.3
 
Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3
 

Dernier

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Dernier (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 

Java and Java platforms

  • 1. Java & Java pla(orms Ilio Catallo - info@iliocatallo.it
  • 2. Outline • Java technology • JEE applica2ons • References
  • 4. Java technology Java is both a programming language and a pla-orm
  • 5. The Java programming language The Java programming language is a high-level, object-oriented programming language firstly released in 1995 class App { public static void main(String[] args) { System.out.println("Hello World!"); } }
  • 6. Pla$orms A pla$orm is the hardware and so.ware environment in which a program runs
  • 7. Java pla'orms A Java pla'orm is a par(cular environment in which Java applica(ons run
  • 8. Pla$orms Pla$orms usually consist of a combina2on of the opera&ng system and the underlying hardware
  • 9. Pla$orms Example: Microso) Windows on Intel architecture
  • 10. Java pla'orm The Java pla*orm is a so#ware-only pla*orm that runs on top of other pla*orms ┌───────────────────────────────────┐ │ Java program │ ├───────────────────────────────────┤ │ Java platform │ ├───────────────────────────────────┤ │ Host platform │ └───────────────────────────────────┘
  • 11. Java pla'orm Every Java pla+orm consists of: • A Java Virtual Machine (JVM) • A set of applica8on programming interfaces (APIs)
  • 12. Java virtual machine The Java Virtual Machine (JVM) is an abstract computer that runs compiled Java programs ┌───────────────────────────────────┐ │ Java program │ ├─────────┬─────────────────────────┤ │ API │ │ ├─────────┘ Java VM │ │ │ ├───────────────────────────────────┤ │ Host platform │ └───────────────────────────────────┘
  • 13. Java virtual machine The JVM is virtual because it is implemented in so7ware on top of a real host pla:orm ┌───────────────────────────────────┐ │ Java program │ ├─────────┬─────────────────────────┤ │ API │ │ ├─────────┘ Java VM │ │ │ ├───────────────────────────────────┤ │ Host platform │ └───────────────────────────────────┘
  • 14. Java virtual machine Java programs are compiled into Java bytecode
  • 15. Java virtual machine Java bytecode is the machine language of the JVM
  • 16. Java API The Java API is a large collec2on of ready-made so9ware components
  • 17. Java API It is grouped into libraries (packages) of related classes and interfaces
  • 18. Java API For instance, the Collec0on API (java.util) provides the most commonly used data structures
  • 19. Java pla'orm specifica0ons There exist three Java pla/orm specifica4ons • Java Standard Edi-on • Java Enterprise Edi-on • Java Micro Edi-on
  • 20. Java pla'orm specifica0ons There exist three Java pla/orm specifica4ons • Java Standard Edi,on • Java Enterprise Edi,on • Java Micro Edi-on
  • 21. Java Standard Edi,on Java Standard Edi,on (JSE) is a pla,orm specifica3on for developing desktop applica,ons
  • 22. Java Standard Edi,on Java Standard Edi,on is the founda,on for developing in the Java language, as it contains the set of Java standard libraries
  • 23. Java Standard Edi,on Java Standard Edi,on is just a specifica(on, not an implementa,on
  • 24. Java Standard Edi,on Vendors and open source projects are free to provide their own implementa6on • Oracle JDK • OpenJDK
  • 25. Java Enterprise Edi.on Java Enterprise Edi.on (JEE) provides APIs and the run6me environment for developing enterprise applica.ons
  • 26. Java Enterprise Edi.on Typical features of an enterprise applica1on • Large-scale • Distributed • Highly-available
  • 27. Java Enterprise Edi.on Java Enterprise Edi.on is a superset of Java Standard Edi.on
  • 28. Java Enterprise Edi.on Therefore, JSE APIs can be used in any JEE applica:on
  • 29. Java Enterprise Edi.on JEE extends the JSE pla/orm with addi$onal APIs: • Java Servlet API (javax.servlet) • JavaServer Pages API (javax.servlet) • Java Persistence API (java.persistence) • Enterprise JavaBeans API (javax.ejb)
  • 30. JEE specifica+on Java Enterprise Edi.on is just a specifica(on, not an implementa.on
  • 31. JEE specifica+on Namely, JEE is an umbrella specifica.on that references a number of other more detailed specifica9on ┌──────────────────────────────────────────────┐ │ ┌──────────────┐ │ │ │ EJB │ │ │ ┌─────────────┐ │Specification │ │ │ │ Servlet │ └──────────────┘ │ │ │Specification│ │ │ └─────────────┘ ┌─────────────┐ │ │ │ JPA │ │ │ ┌─────────────┐ │Specification│ │ │ │ JSP │ └─────────────┘ │ │ │Specification│ │ │ └─────────────┘ │ └──────────────────────────────────────────────┘ JEE specification
  • 32. JEE implementa,ons Vendors and open source projects are free to implement one or more JEE APIs ┌──────────────────────────────────────────────┐ │ ┌──────────────┐ │ │ │ EJB │ │ │ ┌─────────────┐ │Specification │ │ │ │ Servlet │ └──────────────┘ │ │ │Specification│ │ │ └─────────────┘ ┌─────────────┐ │ │ │ JPA │ │ │ ┌─────────────┐ │Specification│ │ │ │ JSP │ └─────────────┘ │ │ │Specification│ │ │ └─────────────┘ │ └──────────────────────────────────────────────┘ JEE specification
  • 33. JEE implementa,ons "Apache Tomcat 8.0 implements the Servlet 3.1 and JavaServer Pages 2.3 specifica?ons" (Apache Tomcat 8.0 documenta3on)
  • 34. JEE implementa,ons "In addi(on to its own "na(ve" API, Hibernate is also an implementa(on of the Java Persistence API (JPA) specifica(on" (Hibernate ORM)
  • 36. JEE Components Java EE applica*ons are made up of components
  • 37. JEE Components A JEE component is a self-contained so/ware unit
  • 38. JEE Components You may already know a par0cular JEE component: servlets public class MyServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response); public void doPost(HttpServletRequest request, HttpServletResponse response); public void init(); public void destroy(); }
  • 39. JEE Components There exist different types of JEE components • Web components • Business components • Applica3on client components
  • 40. JEE Components Web components: • Servlets • JavaServer Pages (JSP) and JavaServer Faces (JSF)
  • 42. JEE Components Applica'on client components: • Applets • Applica+on Clients
  • 43. JEE Containers JEE components live within a container. A container is the JEE run6me environment
  • 44. JEE Containers A container provides certain services to the components it hosts, such as: • Life-cycle management • Dependency injec4on • Concurrency
  • 45. JEE Containers Different kinds of components live in different kinds of containers
  • 46. JEE servers A Java EE server (also called applica&on server) implements the en6re set of JEE APIs and provides the standard JEE containers
  • 47. JEE servers The reference JEE server is Oracle Glassfish. Possible alterna8ve implementa8ons: • IBM WebSphere • Apache TomEE • Red Hat JBoss
  • 48. JEE servers JEE server ┌────────────────────────────────────────────────────┐ │ Web container EJB container │ │ ┌──────────────────────┐ ┌─────────────────────┐ │ │ │ ┌─────────────┐ │ │ ┌─────────────┐ │ │ │ │ │ Servlet A │ │ │ │ EJB D │ │ │ │ │ └─────────────┘ │ │ └─────────────┘ │ │ ┌──────┐ ┌─────────┐ │ │ ┌──────────┐│ │ ┌──────────┐│ │ │ │ │ Browser ├───┼─┤ │ JSP C │├───┤ │ EJB E │├─┼───┤ DB │ └─────────┘ │ │ └──────────┘│ │ └──────────┘│ │ │ │ │ │┌─────────────┐ │ │┌─────────────┐ │ │ └──────┘ │ ││ Servlet B │ │ ││ EJB F │ │ │ │ │└─────────────┘ │ │└─────────────┘ │ │ │ └──────────────────────┘ └─────────────────────┘ │ └────────────────────────────────────────────────────┘
  • 49. Business logic At the heart of any applica0on lies its business logic
  • 50. "We call business logic any program code that pertains to the purpose of a so6ware applica8on"
  • 51. Business logic In a chess game, the business logic handles: • The board and pieces • Their movements • The rules of the game
  • 52. Business logic Such concerns are independent of, e.g., how pieces will be displayed
  • 53. Business logic Such concerns are independent of, e.g., how pieces will be displayed
  • 54. The role of EJBs In a JEE applica+on, EJBs encapsulate the business logic @Stateless public class FlightServiceBean { List<SpecialDeal> getSpecialDeals() { ... } List<Flight> findFlights(String queryString) { ... } }
  • 55. The role of EJBs Moreover, the EJB container provides fundamental services such as security and transac+ons @Stateless @TransactionManagement(TransactionManagementType.CONTAINER) public class FlightServiceBean { List<SpecialDeal> getSpecialDeals() { ... } List<Flight> findFlights(String queryString) { ... } }
  • 56. The role of EJBs Thanks to this, developers are free to focus of defining and implemen6ng the business logic
  • 57. JEE stack However, many vendors and open source projects implement only a subset of the JEE specifica;on
  • 58. JEE stack For instance, Apache Tomcat provides only a Web container
  • 59. Web container Web server ┌──────────────────────────┐ │ │ │ Web container │ │ ┌──────────────────────┐ │ │ │ ┌─────────────┐ │ │ │ │ │ Servlet A │ │ │ │ │ └─────────────┘ │ │ ┌──────┐ ┌─────────┐ │ │ ┌──────────┐│ │ │ │ │ Browser ├───┼─┤ │ JSP C │├─┼───┤ DB │ └─────────┘ │ │ └──────────┘│ │ │ │ │ │┌─────────────┐ │ │ └──────┘ │ ││ Servlet B │ │ │ │ │└─────────────┘ │ │ │ └──────────────────────┘ │ │ │ └──────────────────────────┘
  • 60. Can we built enterprise applica0ons without the whole JEE stack?
  • 61. Can we write enterprise applica.on without the need of an applica.on server?
  • 62. The Spring Framework The solu)on comes in the form of the Spring framework
  • 63. The Spring Framework …but this is something we will inves1gate in the next lecture ;-)
  • 65. References • Antonio Goncalves, Beginning Java EE 7, Apress Publica:ons • Chris Richardson, POJOs in Ac:on, Manning Publica:ons • D, Panda, R. Rahman, D. Lane, EJB3 In Ac:on, Manning Publica:ons • Oracle, GeGng Started
  • 66. References • Bill Venners, The lean, mean, virtual machine • Oracle, Java EE 7 Tutorial • Wikipedia, Java EE