java technologies. introductionvaldo/jate2013/javatech.l00.pdf · 2. java 2, enterprise edition...

16
Preparation of the material was supported by the project „Increasing Internationality in Study Programs of the Department of Computer Science II“, project number VP1–2.2–ŠMM-07-K-02-070, funded by The European Social Fund Agency and the Government of Lithuania. Valdas Rapševičius Vilnius University Faculty of Mathematics and Informatics 2013.02.05 Java Technologies Lecture N 2013.02.05 Valdas Rapševičius. Java Technologies 1

Upload: others

Post on 29-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Preparation of the material was supported by the project „Increasing Internationality in Study Programs of the Department of Computer Science II“, project number VP1–2.2–ŠMM-07-K-02-070, funded by The European Social Fund Agency and the Government of Lithuania.

Valdas Rapševičius Vilnius University

Faculty of Mathematics and Informatics

2013.02.05

Java Technologies Lecture N

2013.02.05 Valdas Rapševičius. Java Technologies 1

Page 2: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Session Outline

• Meet Duke! • Short introduction into the Java Platform • You will learn what is JCP and JSR? • What is “new” in Java SE 7? • The future of Java • Course Overview

– Lectures – Project – Evaluation

• References

2013.02.05 Valdas Rapševičius. Java Technologies 2

Page 3: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Java, JDK

• Java is generic, imperative, object-oriented, reflective programming language

• Java Technology refers to a set of several computer software products and specifications from Sun Microsystems (which has since merged with Oracle Corporation), that together provide a system for developing application software and deploying it in a cross-platform computing environment.

• Always changing … history – http://en.wikipedia.org/wiki/Java_version_history – JDK J2SE (since 1.2, JSR since 1.4) Java SE (since 6)

• Open Source?

– Sun announced in JavaOne 2006 that Java would become free and open source software – Sun released the Java HotSpot virtual machine and compiler as free software under the

GNU General Public License on November 13, 2006, with a promise that the rest of the JDK – Sun released the source code of the Class library under GPL on May 8, 2007, except some

limited parts that were licensed by Sun from 3rd parties who did not want their code to be released under a free software and open-source license.

– Sun's goal is to replace the parts that remain proprietary and closed-source with alternative implementations and make the class library completely free and open source.

– See http://openjdk.java.net/

2013.02.05 Valdas Rapševičius. Java Technologies 3

Page 4: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Java Platform

1. Java 2, Standard Edition (J2SE) is designed for desktop computers. Most often it runs on top of OS X, Linux, Solaris, or Microsoft Windows

2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise-wide applications. It is based on J2SE and adds APIs for server-side computing.

3. Java 2, Micro Edition (J2ME) is a set of technologies and specifications developed for small devices like pagers, mobile phones, and set-top boxes. J2ME uses subsets of J2SE components, such as smaller virtual machines and leaner APIs.

2013.02.05 Valdas Rapševičius. Java Technologies 4

Page 5: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Java Platform

2013.02.05 Valdas Rapševičius. Java Technologies 5

Page 6: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Java SE

2013.02.05 Valdas Rapševičius. Java Technologies 6

Page 7: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Java Community Process (JCP)

• Specifications for J2SE, J2EE, and J2ME are developed under the aegis of the Java Community Process (JCP).

• A specification begins with a Java Specification Request (JSR). An expert group consisting of representatives from interested companies is formed to create the specification.

• The JSR then passes through various stages in the JCP before it is finished. Every JSR is assigned a number.

• See http://jcp.org/en/home/index for everything • Sandbox: http://openjdk.java.net/

2013.02.05 Valdas Rapševičius. Java Technologies 7

Page 8: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Java SE 7: New Features

• JVM support for dynamic languages • Compressed 64-bit pointers • Project Coin:

– Strings in switch – Automatic resource management in try-statement – Improved type inference for generic instance creation – Simplified varargs method declaration – Binary integer literals – Allowing underscores in numeric literals – Catching multiple exception types and rethrowing exceptions with improved type

checking • Concurrency utilities under JSR-166 • New I/O • Library-level support for Elliptic curve cryptography algorithms • XRender pipeline for Java 2D (for modern GPUs) • New platform APIs for the graphics features • Enhanced libraries for new network protocols (SCTP and SDP) • Upstream updates to XML and Unicode

2013.02.05 Valdas Rapševičius. Java Technologies 8

Page 9: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Java SE 8+: What to expect?

• Round the conner – Language-level support for lambda expressions

http://openjdk.java.net/projects/lambda/

public List<T> schwarz(List<T> x, Mapper<T, V> f) { return x.map(w -> new Pair<T,V>(w, f.map(w))) .sorted((l,r) -> l.hashed.compareTo(r.hashed)) .map(l -> l.orig).into(new ArrayList<T>()); }

– More Project Coin

http://openjdk.java.net/projects/coin/ – JSR 310: Date and Time API

http://jcp.org/en/jsr/detail?id=310 – Better integration with JavaFX

http://openjdk.java.net/projects/openjfx/ – Modularization of the JDK (Project Jigsaw)

http://openjdk.java.net/projects/jigsaw/ – Multilanguage VM

http://openjdk.java.net/projects/mlvm/ – OpenCL parallelism?

2013.02.05 Valdas Rapševičius. Java Technologies 9

Page 10: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Course Contents

• Language basics • Essential classes and methods • Design patterns • JVM • Development and configuration tools • Persistence • XML • GUI • Networking • Web • Component Web • Enterprise Application Servers • Web services • Polyglot programming in JVM

2013.02.05 Valdas Rapševičius. Java Technologies 10

Page 11: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Project

• Assemble a group of 1 to 3 students – If not – lecturer will assign you to group

• Choose application topic/domain – If not – lecturer will pick one for you

• Submit the project to VMA – Group contents – Project name – Project Description – Technologies and tools that you are intending to use – Schedule (milestones)

• Confirm with the lecturer – Technologies and tools – Schedule

• Computer classes are for – Consultancies – Presentation of results

• Recommendations – Stick to agreed schedule – Be pro-active – I’m always at your service in the office or by email

2013.02.05 Valdas Rapševičius. Java Technologies 11

Page 12: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Evaluation

• Exam – ½ – Positive evaluation is mandatory! – 5+ practical tasks, you can choose any 3 – 2 hours programming, submit a code to lecturer – Each tasks scores up to 3 points – Tet-a-tet examination, additional questions possible – Additional 1 point is for the inventive solution or a full and fluent

explanation • Project

– ½ – Positive evaluation is mandatory! – Overall project = 5 points based on

• Innovation • Team vs. Scope • Technologies used • Completeness, final result

– Individual contribution = 5 points

2013.02.05 Valdas Rapševičius. Java Technologies 12

Page 13: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

Algorithm

/** * Final score in Java Technologies course. * @param pr project score (0 to 5) * @param pc contribution in the project (0 to 5) * @param ex exam score (0 to 10) * @return final score */ public static int finalScore(int pr, int pc, int ex) { assert pr > 2 && pr <= 5; assert pc > 2 && pc <= 5; assert ex > 4 && ex <= 10; Double sc = (double) (pr + pc + ex) / 2; sc = sc - Math.floor(sc) > 0.5d ? Math.ceil(sc) : Math.floor(sc); return sc.intValue(); }

2013.02.05 Valdas Rapševičius. Java Technologies 13

Page 14: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

#1 Online

• Java SE Downloads http://www.oracle.com/technetwork/java/javase/downloads/index.html

• Java SE Tutorial

http://docs.oracle.com/javase/tutorial/index.html

• Java EE Tutorial http://docs.oracle.com/javaee/6/tutorial/doc/

• Java SE API documentation

http://docs.oracle.com/javase/7/docs/api/index.html

• Java EE API documentation http://docs.oracle.com/javaee/6/api/

• The Java™ Virtual Machine Specification http://docs.oracle.com/javase/specs/jvms/se7/html/index.html

• OpenJDK

http://openjdk.java.net/

2013.02.05 Valdas Rapševičius. Java Technologies 14

Page 15: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

#1 Books

• Joshua Bloch. Effective Java (2nd Edition) http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683

• Madhusudhan Konda. What's New in Java 7?

http://www.amazon.com/Whats-New-Java-7-ebook/dp/B005XSS8VC

• Benjamin J Evans, Martijn Verburg. The Well-Grounded Java Developer: Vital techniques of Java 7 and polyglot programming

http://www.amazon.com/Well-Grounded-Java-Developer-techniques-programming/dp/1617290068

• Charlie Hunt, Binu John. Java Performance

http://www.amazon.com/Java-Performance-Charlie-Hunt/dp/0137142528

• Erich Gamma, et al. Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional Computing Series)

www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612

• Mark Cade, Simon Roberts. Sun Certified Enterprise Architecture for J2EE Technology Study Guide

http://www.amazon.com/Certified-Enterprise-Architecture-Technology-Study/dp/0130449164

2013.02.05 Valdas Rapševičius. Java Technologies 15

Page 16: Java Technologies. Introductionvaldo/jate2013/JavaTech.L00.pdf · 2. Java 2, Enterprise Edition (J2EE) is a comprehensive platform for multi-user, enterprise- wide applications. It

#2 Online

• Ergonomics in the 5.0 Java TM Virtual Machine http://www.oracle.com/technetwork/java/ergo5-140223.html

• Java SE 6 HotSpot™ Virtual Machine Garbage Collection Tuning

http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html

• PrintAssembler instructions https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly

• HSDIS plugin for HotSpot

http://kenai.com/projects/base-hsdis/downloads

• Whats new in JSF 2.0 http://andyschwartz.wordpress.com/2009/07/31/whats-new-in-jsf-2/

• Apache Maven

https://tech.lds.org/wiki/Introduction_to_Maven

• Apache Ant Manual http://ant.apache.org/manual/index.html

• Martin Fowler “Inversion of Control Containers and the Dependency Injection pattern”

http://martinfowler.com/articles/injection.html

2013.02.05 Valdas Rapševičius. Java Technologies 16