Docsity

Java: History, Features, and Applications, Slides of Web Design and Development

Partial preview of the text

Download Java: History, Features, and Applications and more Slides Web Design and Development in PDF only on Docsity!

Web Design & Development

Lecture 2

Intro to Java

History

 Java

 Based on C and C++

 Developed in 1991 for intelligent consumer electronic devices  Green Project (According to Gosling, "the goal was ... to build a system that would let us do a large, distributed, heterogeneous network of consumer electronic devices all talking to each other." )  James Gosling Modified C++

 Named Oak then Java

History….

 Platform independent

 Interpreted Language

 Intermediate Code (Byte Code)

 Reliable

 Multiple inheritance and Operator overloading

removed

 No Pointers because of security reasons

 Built in network support

Why Java???

Motivation 

 Portable WORA!!!!!!

 Simple

 “Pure” Object Oriented Language

 Support for Distributed and Web Applications

 Rich Libraries

 Multithreading , Swing , RMI , NET , SQL …..

 Automatic Garbage Collection

 More Robust

Java Platform

The Java Platform

Intel PowerPC SPARC

Windows Linux OS X Solaris Linux

Java Virtual Machine

App1 App2 App3 App4 App

Object-Oriented

 Fundamentally based on OOP

 All functions belong to classes or objects. No global

variables or functions exist

 All classes by default inherit from a common ancestor

known as “Object”

 “Almost” all data types are objects

 OOP will be covered in a little more detail later.

Distributed / Network

Oriented

 Java grew up in the days of the Internet

 Inherently network friendly

 Original release of Java came with Networking libraries

 Newer releases contain even more for handling distributed applications

 RMI, Transactions

Robust / Secure / Safe

 Designed with the intention of being secure

 No pointer arithmetic or memory management!  The JVM “verifier”  Checks integrity of byte-codes  Dynamic runtime checking for pointer and array access  No buffer overflow bugs!  SecurityManager to check which operations a piece of code is allowed to do  “Sandbox” operation for applets and other untrusted code  Limited set of operations or resources made available  Contrast to ActiveX

Rich Set of Libraries

 Multithreading

 Swing

 Regular Expression

 NET

 SQL

 Util

 Serialization …………….

Disadvantages 

 Java performance IS slower than C/C++

 Tradeoff between development time vs. run time  Additional checks in Java which make is secure and robust and network aware etc, all have a small cost.

 BUT

 JIT compilation and HotSpot  Dynamic compilation of bytecode to native code at runtime to improve performance  HotSpot optimizes code on the fly based on dynamic execution patterns  Can sometimes be even faster than compiled C code!

 Increasing processing speeds helps in overcoming

this short fall

Microsoft vs. Java

 Java is platform independent

 Was considered a threat to Microsoft’s dominance

 Sun vs. Microsoft Law Suit

 Microsoft’s latest response to Java

 C#

 Very similar to Java in structure and style
 Some improvements over past releases of Java
(which have now emerged in Java 1.5)