Wprowadzenie do platformy Java i programowanie w języku Java
Java New Media com
-
Upload
deepika-dahiya -
Category
Documents
-
view
220 -
download
0
Transcript of Java New Media com
-
8/8/2019 Java New Media com
1/155
Copyright 1997-8 Alex Chaffee
Java: A to ZJava: A to Z
Delivered By:
Alexander Day Chaffee, Purple Technology
Original Creator of Gamelan
(http://java.developer.com/ - EarthWeb)[email protected]
-
8/8/2019 Java New Media com
2/155
Copyright 1997-8 Alex Chaffee
Purple TechnologyPurple TechnologyJava Training and Consulting
All levels of courseshttp://www.purpletech.com/
-
8/8/2019 Java New Media com
3/155
Copyright 1997-8 Alex Chaffee
What is Java?
What is Java?
Largest island of the equatorial achipelago
of Indonesia
Famous for beaches and coffee
An island
-
8/8/2019 Java New Media com
4/155
Copyright 1997-8 Alex Chaffee
What is Java?
What is Java?
A programming language
Developed by Sun Microsystems
Open specification
-
8/8/2019 Java New Media com
5/155
Copyright 1997-8 Alex Chaffee
W
hat is Java?W
hat is Java?An architecture
Virtual Machine
-
8/8/2019 Java New Media com
6/155
Copyright 1997-8 Alex Chaffee
W
hat is Java?W
hat is Java?A platform
Libraries / APIs
Applications
Applets
-
8/8/2019 Java New Media com
7/155
Copyright 1997-8 Alex Chaffee
W
hat is Java?W
hat is Java?An Operating System (OS)
Tailored for NCs and Embedded Systems
Not an OS for PCs
-
8/8/2019 Java New Media com
8/155
Copyright 1997-8 Alex Chaffee
W
hat is Java?W
hat is Java?A really good buzzword
Coined by Kim Polese
-
8/8/2019 Java New Media com
9/155
Copyright 1997-8 Alex Chaffee
W
hy Java?W
hy Java?High Productivity
Low Cost
Run Anywhere
N-tier Applications
-
8/8/2019 Java New Media com
10/155
Copyright 1997-8 Alex Chaffee
W
here is Java?W
here is Java?Server-side programming
Enterprise computing
Distributed computing
Client-side multimedia
-
8/8/2019 Java New Media com
11/155
Copyright 1997-8 Alex Chaffee
W
here is Java heading?W
here is Java heading?Clients (Network, Distributed Computing
with Nodes)
Servers (Web servers, collaboration
services)
Embedded (TV Set-top, cell phones, smart
cards)
-
8/8/2019 Java New Media com
12/155
Copyright 1997-8 Alex Chaffee
F
acts andF
iguresF
acts andF
igures
-
8/8/2019 Java New Media com
13/155
Copyright 1997-8 Alex Chaffee
Numberof Java DevelopersNumberof Java Developers
(IDC)(IDC)
-
8/8/2019 Java New Media com
14/155
Copyright 1997-8 Alex Chaffee
R
ealR
eal--world Java Examplesworld Java Examples
-
8/8/2019 Java New Media com
15/155
Andersen ConsultingAndersen Consulting60,000 employees who travel to client sites
VERY heterogeneous computing
environments
On-line travel system for their in-house
needs
Privileges according to employee status
-
8/8/2019 Java New Media com
16/155
Copyright 1997-8 Alex Chaffee
Andersen Consulting (cont.)Andersen Consulting (cont.)"Java is absolutely ready for prime time. It's
the most bulletproof language we've used.
We don't have to worry about memoryleaks. If we had done this in C, we would
still be debugging."
-Elmer Baldwin, President, via WorldNetwork.
-
8/8/2019 Java New Media com
17/155
Copyright 1997-8 Alex Chaffee
CSXrailway shippingCSXrailway shipping
Find out which train(s) have your freight on
map of USA
Click on train and see what freight belongs
to your company
Saving CSX $10M in next year
-
8/8/2019 Java New Media com
18/155
Copyright 1997-8 Alex Chaffee
CSXrailway shipping (cont.)CSXrailway shipping (cont.)
CSX, using Java, has halved the time to
write code and moved to a zero cost
software distribution model.
At the same time, CSX has moved to a
multi-client environment, improved
satisfaction, expanded reach and self-enabled the customer
-
8/8/2019 Java New Media com
19/155
Copyright 1997-8 Alex Chaffee
CSX (cont.)CSX (cont.)
"Java is CSX's enterprise computing solution Java
is deployed everywhere and at every level of CSX.
And we are working on architecturally purifyingCSX development," said Marshall Gibbs, assistant
VP of enterprise solutions at CSX Technology in
Jacksonville, FL, the IT unit of CSX Corp. "Our
ROI on projects where we use Java has increasedby 10 percent."
-
8/8/2019 Java New Media com
20/155
Copyright 1997-8 Alex Chaffee
Dun & BradstreetDun & Bradstreet
On-line office supply catalogue for in-house
use
Privileges according to status at company
-
8/8/2019 Java New Media com
21/155
Copyright 1997-8 Alex Chaffee
FederalExpressFederalExpress
"Java is our primary targeted application
platform for internal apps." says FedEx CIO
Dennis Jones. "No internal applicationwork is occurring for the client aside from
Java development."
Using Symantec Caf
-
8/8/2019 Java New Media com
22/155
Copyright 1997-8 Alex Chaffee
Ford MotorCredit Company.Ford MotorCredit Company.
"Ford Credit is using Java and the Internet
to better serve our customers. Ford Credit is
currently using Java to provide customers aconvenient way to access account
information - 24 hours a day, 7 days a
week." -Terry Bone, Ford Motor CreditCompany
-
8/8/2019 Java New Media com
23/155
Copyright 1997-8 Alex Chaffee
NationalLibrary of MedicineNationalLibrary of Medicine
(NIH)(NIH)Using Java for health and information
professionals to access database
Users' displays tailored to suit information
(instead of line-oriented displays)
"The development ofJava saved us the cost of
developing to platform-specific windowenvironments and greatly speeded up our
delivery of a working prototype version of
HSTAT (roughly six months from design to
delivery)."
-
8/8/2019 Java New Media com
24/155
Copyright 1997-8 Alex Chaffee
First Union Corp.First Union Corp.
"Java gives us greater selection of what
applications we can use. Well over 90% of
development is Java based," said MichaelLove, vice president of the smart card
initiative at First Union Corp in Charlotte,
NC.
-
8/8/2019 Java New Media com
25/155
Copyright 1997-8 Alex Chaffee
Java FoundationsJava Foundations
-
8/8/2019 Java New Media com
26/155
What is a computer?What is a computer?
CPU
Memory
Input/output devices
-
8/8/2019 Java New Media com
27/155
What is a programmingWhat is a programming
language?language?Set of instructions for computer
Stored in memory, executed by CPU
Grammar
Examples
Perl
C
C++
BASIC
LISP
-
8/8/2019 Java New Media com
28/155
Lifecycle of a programLifecycle of a program
Source code
Compiler
Object code
Linker
Executable code
-
8/8/2019 Java New Media com
29/155
What is a Script?What is a Script?
A script is a program, but not all programs
are scripts
Scripting Languages:
Lingo
Perl
JavaScript
TCL
-
8/8/2019 Java New Media com
30/155
Script vs. ProgramScript vs. Program
Scripts are
smaller
easier learning curve
less scalable
number of developers per script is usually one
more task-specificusually tailored to a specific program or
function
fewer functions available
-
8/8/2019 Java New Media com
31/155
Script vs. ProgramScript vs. Program
Programs are
usually larger
more powerful
more task-independent
more scalable
programs can have dozens of programmers
more code libraries
can produce their own graphical user interface
-
8/8/2019 Java New Media com
32/155
Lifecycle of a scriptLifecycle of a script
Source code
Interpreter
-
8/8/2019 Java New Media com
33/155
PerlPerl
Right on the line between scripting and
programming language
Possible to write large programs in Perl
Not a good idea
Many libraries available for Perl
Not very good GUI support
Contains compiler and interpreter
-
8/8/2019 Java New Media com
34/155
Copyright 1997-8 Alex Chaffee
Java CodeJava Code
Simple Object Oriented
Distributed Interpreted
Robust Safe
Secure Architecture Neutral
PortableH
igh PerformanceMulti-Threaded Dynamic (GC)
-
8/8/2019 Java New Media com
35/155
Copyright 1997-8 Alex Chaffee
Boy Scout CodeBoy Scout Code
trustworthy loyal
helpful friendly
courteous kind
obedient cheerful
thrifty braveclean reverent
-
8/8/2019 Java New Media com
36/155
Copyright 1997-8 Alex Chaffee
HistoryHistory
Green Project / FirstPerson / Oak
Consumer electronics
Set-top boxes
James Gosling, Patrick Naughton
-
8/8/2019 Java New Media com
37/155
Copyright 1997-8 Alex Chaffee
HistoryHistory
LiveOak (1993)
Arthur van Hoff
WebRunner (1994)
Patrick Naughton, Jonathan Payne
Java
Kim Polese
-
8/8/2019 Java New Media com
38/155
Copyright 1997-8 Alex Chaffee
HistoryHistory
Fall 1994: WebRunner written
Spring 1995: Java/HotJava announced at
SunWorld 95
Fall 1995: Java Day New York
Birth of Gamelan
Spring 1996: First JavaOne (San Francisco)
-
8/8/2019 Java New Media com
39/155
What is an Operating System?What is an Operating System?
A program that runs other programs
Sits between programs and devices
Manages scheduling of concurrent
programs
Provides API to applications
Application Program Interface
-
8/8/2019 Java New Media com
40/155
What is a Platform?What is a Platform?
Combination of OS, API, installed
programs, and hardware
Sometimes means one of those things,
sometimes means many
-
8/8/2019 Java New Media com
41/155
Copyright 1997-8 Alex Chaffee
Platform Independent: Why?Platform Independent: Why?
Write once, run anywhere
One code base to develop
Upwardly compatible with new technology
Writing code that will run on machines that
haven't been invented yet
Cross-compatible with existing installedbase
E.g. all the computers on the Web
-
8/8/2019 Java New Media com
42/155
Copyright 1997-8 Alex Chaffee
CrossCross--PlatformPlatform
Write-Once-Run-Anywhere
AIX, HP-UX, MacOS, OS2, Win95, WinNT,
Netware, UnixWare, Irix, Solaris, and others
-
8/8/2019 Java New Media com
43/155
Copyright 1997-8 Alex Chaffee
Platform Independent: How?Platform Independent: How?
Virtual Machine
Application Application Application
Windows MacOS Unix
-
8/8/2019 Java New Media com
44/155
Copyright 1997-8 Alex Chaffee
Java Class LifecycleJava Class Lifecycle
Source -> Bytecode -> Interpreter
-
8/8/2019 Java New Media com
45/155
Java Class LifecycleJava Class Lifecycle
Source File
(.java)
Class File
(.class)
Compiler
(javac)
Java Virtual Machine (JVM)
ClassLoader
Bytecode Verifier
InterpreterJust-in-time
compiler
Security Manager
Operating System
Network
or
File System
= security gateway
-
8/8/2019 Java New Media com
46/155
Copyright 1997-8 Alex Chaffee
Security ArchitecureSecurity Architecure
Has to go through Verifier on one side and
Security Manager on the other
Sandbox
Cryptography / signed applets
-
8/8/2019 Java New Media com
47/155
Copyright 1997-8 Alex Chaffee
SecureSecure
Java:
Adjustable security: untrusted through levels
of trust
ActiveX:
Binary trust: all or nothing
-
8/8/2019 Java New Media com
48/155
Copyright 1997-8 Alex Chaffee
Java vs. ActiveXJava vs. ActiveX
Java ActiveX
File IO yes yes
Network IO yes yes
Applet Caching yes yes
Erase hard disk no yes
Upload confidential informationno yes
-
8/8/2019 Java New Media com
49/155
Copyright 1997-8 Alex Chaffee
ObjectObject--OrientedOriented
Encourages more flexible and reliable
designs
Fosters reuse of code and design
Reduces maintenance costs
-
8/8/2019 Java New Media com
50/155
Copyright 1997-8 Alex Chaffee
Automatic MemoryAutomatic Memory
ManagementManagementGreatly improves developer productivity
Reduces memory leakage problems
-
8/8/2019 Java New Media com
51/155
Copyright 1997-8 Alex Chaffee
Powers of tenPowers of ten
Cost of fixing problems
Design = $1
Development = $10
Debugging = $100
Deployment = $1000
Brooks, The Mythical Man MonthJava helps at early stages
Problems are caught early
-
8/8/2019 Java New Media com
52/155
Copyright 1997-8 Alex Chaffee
Distributed ComputingDistributed Computing
Applications reside where theyre needed
saving valuable desktop space
Accessible from any connected location
Native support for distributed app
development (java.net, RMI, CORBA,
DCOM)
-
8/8/2019 Java New Media com
53/155
Copyright 1997-8 Alex Chaffee
ServerServer--side strengthside strength
Built-in support for networking makes
development easy
-
8/8/2019 Java New Media com
54/155
Copyright 1997-8 Alex Chaffee
33--tierandntierandn--tierdevelopmenttierdevelopment
Flexible implementations separate user
interface from business logic and from
database storage
-
8/8/2019 Java New Media com
55/155
Copyright 1997-8 Alex Chaffee
ClientClient--side Javaside Java
-
8/8/2019 Java New Media com
56/155
Copyright 1997 Alex Chaffee
ApplicationsApplications
Installed locally
Like any other application (Word, Photoshop)
Run as a local process
Can make network connections freely
No security restrictions
Still safety restrictions (e.g. cant write to
random memory)
-
8/8/2019 Java New Media com
57/155
Copyright 1997 Alex Chaffee
AppletsApplets
Live inside a browser
Stored as class files on a Web server
Are delivered through the internet or
intranet
On-demand, when needed
Run inside a Java-enabled web browser
Always downloads the latest version
Sometimes cached locally, but not reliably
-
8/8/2019 Java New Media com
58/155
Applet SecurityApplet Security
Security restrictions
Are secure
Limited or no access to the local machine
(client)
-
8/8/2019 Java New Media com
59/155
Copyright 1997 Alex Chaffee
Applets (Diagram)Applets (Diagram)Browser Web Server
face.html
face.class
Here is my face:
-
8/8/2019 Java New Media com
60/155
Copyright 1997 Alex Chaffee
Client
Sockets andPorts (Diagram)Sockets andPorts (Diagram)
port 13
port 80
Time Service
Web Service
Socket
Server
Socket
-
8/8/2019 Java New Media com
61/155
Copyright 1997 Alex Chaffee
Applet as InputFormApplet as InputForm
Interactive
Verify input
Can send data to CGI or to custom server
More efficient use of client and server
resources
-
8/8/2019 Java New Media com
62/155
Copyright 1997 Alex Chaffee
Applet Security ModelApplet Security Model
a/k/a The Sandbox
Cant access local files
Cant launch local applications
Can only connect to applet host, i.e. the
host from which the applet itself was
downloaded
Cant accept connections, i.e. cant act as a
server
-
8/8/2019 Java New Media com
63/155
Applet TagApplet Tag
-
8/8/2019 Java New Media com
64/155
BrowserVirtualMachineBrowserVirtualMachine
Every browser has its own VM
Starts up either at launch or the first time
Java is needed
Starting Java...
-
8/8/2019 Java New Media com
65/155
Copyright 1997-8 Alex Chaffee
BrowsercompatibilityBrowsercompatibility
Every version ofJava is slightly different
Browsers, yuck
Navigator 2.x, 3.x, 4.x
Internet Explorer 3.x, 4.x
HotJava
We need...
-
8/8/2019 Java New Media com
66/155
Copyright 1997-8 Alex Chaffee
The ActivatorThe Activator
-
8/8/2019 Java New Media com
67/155
-
8/8/2019 Java New Media com
68/155
Copyright 1997-8 Alex Chaffee
Microsoft's JavaMicrosoft's Java
-
8/8/2019 Java New Media com
69/155
Copyright 1997-8 Alex Chaffee
Java vs. HTMLJava vs. HTML
HTML is a presentation format
Was never meant to be used for interactive
applications
Latency, or turn-around time, is too high
Dynamic HTML is really just window
dressing
-
8/8/2019 Java New Media com
70/155
Copyright 1997-8 Alex Chaffee
Java vs. HTMLJava vs. HTML
Java is a full-fledged application language
High-level of interaction with low-latency
More powerful and easier to use interfaces
Flexible enough to play any part in a
solution
-
8/8/2019 Java New Media com
71/155
Copyright 1997-8 Alex Chaffee
Java can do it allJava can do it all
Server-side or back-end processing
Middleware to transport and translate
information
Front-end user interface
Adapts to client: from PCs, NCs to Hand-
held devices
-
8/8/2019 Java New Media com
72/155
Copyright 1997-8 Alex Chaffee
Marimba CastanetMarimba Castanet
Marimba Castanet delivers applications
Changes nature of software
No more upgrades! Just automatic updates
http://www.marimba.com/
Founded by four original Java team
members
-
8/8/2019 Java New Media com
73/155
Java vs. JavaScriptJava vs. JavaScript
Totally different technologies
JavaScript
Browser scripting language
Integrated with HTML page
Similar syntax
-
8/8/2019 Java New Media com
74/155
Java and MultimediaJava and Multimedia
-
8/8/2019 Java New Media com
75/155
Java and StreamingJava and Streaming
Streaming - starting to play a sound or
video before it has completely downloaded
A few streaming players written in Java
Flash
Shockwave
-
8/8/2019 Java New Media com
76/155
Multimedia FAQMultimedia FAQ
-
8/8/2019 Java New Media com
77/155
Is Java lowIs Java low--bandwidthbandwidth
friendly?friendly?Con:
Startup time
Need to load class files as well as media files
Pro:
Complete control over what media you
download at what timeClass files usually small
Is there an authoringIs there an authoring
-
8/8/2019 Java New Media com
78/155
Is there an authoringIs there an authoring
environment to help youwriteenvironment to help youwrite
Java?Java?A few packages allow you to create
animations or ads and output class files
There are plenty of IDEs that require you towrite code
Many IDEs use Java Beans to make
programming more visual
How does one with noHow does one with no
-
8/8/2019 Java New Media com
79/155
How does onewithnoHow does onewithno
programmingknowledgeprogrammingknowledge
oversee a Java basedproject?oversee a Java basedproject?
-
8/8/2019 Java New Media com
80/155
What are some simpleuses ofWhat are some simpleuses of
Java on a Web site?Java on a Web site?Playing a sound
Displaying an animation
better to use GIF89
Interactive form
better to use JavaScript
Interactive banner ad
What's a good price to pay forWhat's a good price to pay for
-
8/8/2019 Java New Media com
81/155
What s a goodprice to pay forWhat s a goodprice to pay for
a Java programmeryou aren'ta Java programmeryou aren't
sleepingwith?sleepingwith?
$50-$150 / hr
-
8/8/2019 Java New Media com
82/155
Is Java good fordevelopingIs Java good fordeveloping
games?games?Sure, if you keep the window small
MPlayer
http://www.mplayer.com/java/games/
-
8/8/2019 Java New Media com
83/155
WillJava be around 2 yearsWillJava be around 2 years
fromnow?fromnow?Absolutely
-
8/8/2019 Java New Media com
84/155
Can you showme somekewlCan you showme somekewl
stuff done in Java?stuff done in Java?http://www.tdb.uu.se/~karl/brain.html
http://www.mplayer.com/java/games/
http://fragisland.fragzone.se
-
8/8/2019 Java New Media com
85/155
Copyright 1997-8 Alex Chaffee
ServerServer--side Javaside Java
-
8/8/2019 Java New Media com
86/155
Copyright 1997-8 Alex Chaffee
ServletsServlets
Cross-platform server-side scripting
Like CGI, only cooler
-
8/8/2019 Java New Media com
87/155
Copyright 1997-8 Alex Chaffee
Java Web ServerJava Web Server
Server written in Java
Runs servlets
Cheap
-
8/8/2019 Java New Media com
88/155
Copyright 1997-8 Alex Chaffee
Java Application ServerJava Application Server
Based on Java Web Server
High-performance
Enterprise Java Beans
-
8/8/2019 Java New Media com
89/155
Copyright 1997-8 Alex Chaffee
Enterprise Java BeansEnterprise Java Beans
Framework for enterprise servers
Adds transactions, persistence,
multithreading to server
Deals with tough issues, keeping server-side
business objects simple
Many EJB servers (IBM, Weblogic,JavaSoft, etc.)
-
8/8/2019 Java New Media com
90/155
Copyright 1997-8 Alex Chaffee
Java ComponentsJava Components
-
8/8/2019 Java New Media com
91/155
Copyright 1997-8 Alex Chaffee
Spaghetti CodeSpaghetti Code
Business logic mingled with systems code
Ported to legacy systems
Complex to developExpensive to maintain
-
8/8/2019 Java New Media com
92/155
Copyright 1997-8 Alex Chaffee
Java BeansJava Beans
Marketable software parts
Business applications as reusable
components
Leverages legacy systems
Easy to build/extend
Easy to distribute
-
8/8/2019 Java New Media com
93/155
Copyright (c) 1997 Alex Chaffee
What is a component?What is a component?
Software part
Self-contained, independent
Plug-and-play, drag-and-drop Interact and interoperate with other
components
Assemble components to create anapplication
Ready for use by visual programming tools
Marketable
-
8/8/2019 Java New Media com
94/155
Copyright 1997-8 Alex Chaffee
Split DevelopmentSplit Development
JavaBeans producers
Create components for user-interface and
business-logicJavaBeans consumers
Use JavaScript Applet Embedding for web
pagesUse JavaStudio and other visual development
tools
-
8/8/2019 Java New Media com
95/155
Copyright 1997-8 Alex Chaffee
CommercialUserCommercialUser--InterfaceInterface
JavaBeansJavaBeansJScape (www.jscape.com)
KL Group (www.klg.com)
Lotus Kona project (www.lotus.com)
Rogue Wave
Dundas
Many more: see
http://www.javasoft.com/beans/
-
8/8/2019 Java New Media com
96/155
Copyright 1997-8 Alex Chaffee
Enterprise Java BeansEnterprise Java Beans
Adds business services to Java
Transactions, naming, etc.
Simplified development
dont need to worry about threading, locking,
transaction issues
IBM heavily involved
-
8/8/2019 Java New Media com
97/155
Copyright 1997-8 Alex Chaffee
Java MythsJava Myths
-
8/8/2019 Java New Media com
98/155
Copyright 1997-8 Alex Chaffee
Myth: Java is ProprietaryMyth: Java is Proprietary
Truly open standards
Developed in collaboration with other partners
IBM, Symantec, Intel, Oracle, Long period of public comment and revision
Several "clean-room" implementations underway
Kaffe
Sun does not compete with application developers
Or does it? (Java Application Server, HotSpot)
Java is an ISO Publically Available Standard
approved 20 to 2
M h J hM h J h
-
8/8/2019 Java New Media com
99/155
Copyright 1997-8 Alex Chaffee
Myth: Java has poorMyth: Java has poor
performanceperformanceVideo Games
Frag Island Quake Rendering Engine
(http://fragisland.fragzone.se/)Warp - Karl Hornell is God
(http://www.tdb.uu.se/~karl/java/warp.html)
Built-in Multi-threading improves
performance
M h J hM h J h
-
8/8/2019 Java New Media com
100/155
Copyright 1997-8 Alex Chaffee
Myth: Java has poorMyth: Java has poor
performanceperformance Interpreter is fine for IO-bound apps
(including UI)
Very fast with Just-in-time (JIT) compilersNow available on most platforms
HotSpot
Object-oriented optimizationGenerational Garbage Collection
malloc/free test: JVM 18 sec, MSJVM 8 sec, C++ 6
sec, HotSpot 2 sec.
Many other enhancements
M h J hM h J h
-
8/8/2019 Java New Media com
101/155
Copyright 1997-8 Alex Chaffee
Myth: Java has poorMyth: Java has poor
performanceperformanceCompile to native code where possible
Compile server-side applications directly to
the platform on which theyll be used
SuperCede and Symantec Caf/Visual Caf
support this
Note: lose some benefits ofJava (notablydynamic linking)
-
8/8/2019 Java New Media com
102/155
Copyright 1997-8 Alex Chaffee
Myth: Java is immatureMyth: Java is immature
Compiler Bugs
Almost none in real-world experience
Java Compatibility Test required by all JavaVMlicensees
-
8/8/2019 Java New Media com
103/155
Copyright 1997-8 Alex Chaffee
Myth: Java is immatureMyth: Java is immature
Class Library Bugs
AWT in JDK 1.1 much improved
JFC takes Java UI to the next level
-
8/8/2019 Java New Media com
104/155
Copyright 1997-8 Alex Chaffee
Myth: Java is immatureMyth: Java is immature
Java Virtual Machine problems
Most are from implementations in browsers
They lag behind JDK releasesAffects cross-platform compatibility
100% Pure Java crusade, run seamlessly across
platforms
Activator
M th W itM th W it
-
8/8/2019 Java New Media com
105/155
Copyright 1997-8 Alex Chaffee
Myth: Write once,runMyth: Write once,run
anywhereanywhereShould be, Write once, debug everywhere,
run anywhere
Need a good debugger (like Caf)
-
8/8/2019 Java New Media com
106/155
Copyright 1997-8 Alex Chaffee
Java Myths: NCs vs. PCsJava Myths: NCs vs. PCs
PC vs NC: reality both will co-exist and
overlap in functionality
Network and server load issues: realitycareful system administration and caching
required
Don't need to throw everything away andstart from scratch
-
8/8/2019 Java New Media com
107/155
Copyright 1997-8 Alex Chaffee
Myth: Java vs. MicrosoftMyth: Java vs. Microsoft
Java works great under Microsoft OS
IIS has full Java integration for ASPs
-
8/8/2019 Java New Media com
108/155
Copyright 1997-8 Alex Chaffee
Java Libraries and APIsJava Libraries and APIs
Java API StrategyJava API Strategy
-
8/8/2019 Java New Media com
109/155
Copyright 1997-8 Alex Chaffee
Java API StrategyJava API Strategy
-
8/8/2019 Java New Media com
110/155
Copyright 1997-8 Alex Chaffee
Core Libraries (APIs)Core Libraries (APIs)
UI
JFC
IO
Net
JDBC
RMI
-
8/8/2019 Java New Media com
111/155
Copyright 1997-8 Alex Chaffee
Extended APIsExtended APIs
Electronic Commerce
Network Management
Security
JavaBeans - GUI Components
Enterprise Java - Enterprise Wide Backend Database
Connectivity
Server - Web Server or Distributed Applications
JavaMedia - Multimedia
-
8/8/2019 Java New Media com
112/155
Copyright 1997-8 Alex Chaffee
UserInterface: AWTUserInterface: AWT
Based on native widgets
Native look-and-feel
Simple components
-
8/8/2019 Java New Media com
113/155
Copyright 1997-8 Alex Chaffee
Swing/JFCSwing/JFC
Builds on AWT and IFC
Pluggable look and feel
Rich set of pre-defined components
Fully customizable
Simplify commercial GUI development
Open component market
-
8/8/2019 Java New Media com
114/155
Copyright 1997-8 Alex Chaffee
Swing GUISwing GUI
-
8/8/2019 Java New Media com
115/155
Copyright 1997-8 Alex Chaffee
AFC /WFCAFC /WFC
Microsoft's alternative
Write once, run on Windows
Out as of March 11, 1998
-
8/8/2019 Java New Media com
116/155
Copyright 1997-8 Alex Chaffee
Standard ExtensionsStandard Extensions
Servlets
InfoBus
Java Help
JavaMail
-
8/8/2019 Java New Media com
117/155
Copyright 1997-8 Alex Chaffee
Java and BusinessJava and Business
JDBC
JNDI (Java Naming and Directory
Interface)Java Transaction Services
Enterprise Java Beans
-
8/8/2019 Java New Media com
118/155
Copyright 1997-8 Alex Chaffee
Distributed ComputingDistributed Computing
-
8/8/2019 Java New Media com
119/155
Copyright 1997-8 Alex Chaffee
java.netjava.net
uses TCP/IP
works on all Java platforms
all open protocols of the Internet
HTTP, FTP, SMTP, IMAP
Source code:
Socket s = new Socket(www.internet.com,80);
-
8/8/2019 Java New Media com
120/155
OtherNetworkTechnologiesOtherNetworkTechnologies
RMI
CORBA
JDBC
Other JavaOther Java
-
8/8/2019 Java New Media com
121/155
Copyright 1997-8 Alex Chaffee
OtherJavaOtherJava
Initiatives/EnvironmentsInitiatives/Environments
-
8/8/2019 Java New Media com
122/155
Copyright 1997-8 Alex Chaffee
JavaPCJavaPC
Turn old PCs into NCs
-
8/8/2019 Java New Media com
123/155
Copyright 1997-8 Alex Chaffee
PersonalJavaPersonalJava
Tailored for products such as mobile
phones, set top boxes, screenphones, mid-
range mobile phonesDesigned to fit in devices with 2 Mb or less
-
8/8/2019 Java New Media com
124/155
Copyright 1997-8 Alex Chaffee
Embedded JavaEmbedded Java
tailored for small memory, high volume
products
Tailored for products such as industrialcontrollers, pagers, routers, switches
Designed to fit in devices < .5 Mb ROM
Doesn't require general purpose appletdownloading capabilities
Includes the Java VM and core set of APIs
-
8/8/2019 Java New Media com
125/155
Copyright 1997-8 Alex Chaffee
Java CardJava Card
Use in Smart Cards
Java Ring
Dallas Semiconductor
32K program RAM, 6K data RAM
Serial port interface
Contains private key cryptoRuns off the 1 bits
Auto-zeroing RAM
-
8/8/2019 Java New Media com
126/155
Copyright 1997-8 Alex Chaffee
OtherCompaniesOtherCompanies
-
8/8/2019 Java New Media com
127/155
Copyright 1997-8 Alex Chaffee
NetscapeNetscape
First Java licensee
Recently announced they're canceling their
Java programJava will still work in Netscape with
Activator etc.
Also working (halfheartedly) on Javagator
-
8/8/2019 Java New Media com
128/155
Copyright 1997-8 Alex Chaffee
MicrosoftMicrosoft
COM integration
IIS
AFC / WFC
Visual J++ 6.0
SDKJ 3.0 just released in beta
Write once, run on Windows
Did someone say lawsuit?
-
8/8/2019 Java New Media com
129/155
Copyright 1997-8 Alex Chaffee
SymantecSymantec
First with first out with dev tools, an IDE, a
RAD IDE, a JIT, and a database-oriented
productDeveloping JFC core technologies
Developing JFC look-and-feels
Just-in-time compiler keeps getting betterEnhancing debugger support
-
8/8/2019 Java New Media com
130/155
Copyright 1997-8 Alex Chaffee
IBMIBM
VisualAge forJava - nice RAD tool
San Francisco
Enterprise Java Beans
Licensing picoJava
-
8/8/2019 Java New Media com
131/155
Copyright 1997-8 Alex Chaffee
Developing JavaDeveloping Java
ll
-
8/8/2019 Java New Media com
132/155
Copyright 1997-8 Alex Chaffee
Developing Java:IDEsDeveloping Java:IDEs
Best ones are on PC
Symantec Caf
Borland JBuilder
Microsoft Visual J++
l S dl S d
-
8/8/2019 Java New Media com
133/155
Copyright 1997-8 Alex Chaffee
Developing Java: Java StudioDeveloping Java: Java Studio
C lC l
-
8/8/2019 Java New Media com
134/155
Copyright 1997-8 Alex Chaffee
ConclusionConclusion
-
8/8/2019 Java New Media com
135/155
Copyright 1997-8 Alex Chaffee
[APPLAUSE]
-
8/8/2019 Java New Media com
136/155
Copyright 1997-8 Alex Chaffee
[DINNER]
R l W b Si RR l W b Si R
-
8/8/2019 Java New Media com
137/155
Copyright 1997-8 Alex Chaffee
RelevantWeb SiteResourcesRelevantWeb SiteResources
Javasoft & Sun: www.javasoft.com &
www.sun.com
Developer.com: java.developer.comSymantec: www.symantec.com
IBM: www.ibm.com/java
Borland: www.borland.com
SuperCede: www.supercede.com
Purple Tech: www.purpletech.com
C diC di
-
8/8/2019 Java New Media com
138/155
Copyright 1997-8 Alex Chaffee
CreditsCredits Purple Technology
Java Training and Consulting
Symantec Corp.
J
ava Development Tools Advanced Web Technologies
Java-only training, mentoring, and consulting company
Sun Microsystems
JavaOne presentations: Lew Tucker, Alan Baratz,James Gosling
Personal Thanks
Lew Tucker, Gerry Seidman, Ian McFarland
A di N ki B iA di N ki B i
-
8/8/2019 Java New Media com
139/155
Copyright 1997 Alex Chaffee
Appendix: Networking BasicsAppendix: Networking Basics
N t ki B iN t ki B i
-
8/8/2019 Java New Media com
140/155
Copyright 1997 Alex Chaffee
Networking BasicsNetworking Basics
TCP/IP vocabulary and concepts
WWW vocabulary and concept
T l t A li tiT l t A li ti
-
8/8/2019 Java New Media com
141/155
Copyright 1997 Alex Chaffee
Telnet ApplicationTelnet Application
Demo of time service (port 13)
Demo of login service (port 23)
Demo ofHTTP service (port 80)
A N t k IA N t k I
-
8/8/2019 Java New Media com
142/155
Copyright 1997 Alex Chaffee
A NetworkIs...A NetworkIs...
node
any device on the network
hosta computer on the network
address
computer-readable name for hosthost name
human-readable name for host
A N t k DA N t k D
-
8/8/2019 Java New Media com
143/155
Copyright 1997 Alex Chaffee
A NetworkDoes...A NetworkDoes...
datagram (or packet)
little bundle of information
sent from one node to anotherprotocol
roles, vocabulary, rules for communication
IPthe Internet Protocol
TCP/IP Th I t t P t lTCP/IP Th I t t P t l
-
8/8/2019 Java New Media com
144/155
Copyright 1997 Alex Chaffee
TCP/IP: The InternetProtocolTCP/IP: The InternetProtocol
Physical Network
Transport Layer (TCP, UDP)
Internet Layer (IP)
Application Layer (HTTP, FTP, SMTP)
TCP/UDP/IPTCP/UDP/IP
-
8/8/2019 Java New Media com
145/155
Copyright 1997 Alex Chaffee
TCP/UDP/IPTCP/UDP/IP IP
raw packets
the Internet Layer
TCP
data stream
reliable, ordered
the Transport Layer
UDP user datagrams (packets)
unreliable, unordered
the Transport Layer
Th Th ITh Th I
-
8/8/2019 Java New Media com
146/155
Copyright 1997 Alex Chaffee
The Three I sThe Three I s
internet
any IP-based network
Internetthe big, famous, world-wide IP network
intranet
a corporate LAN-based IP networkextranet
accessing corporate data across the Internet
IP AddressesIP Addresses
-
8/8/2019 Java New Media com
147/155
Copyright 1997 Alex Chaffee
IPAddressesIPAddresses
IP Address: identifies a host
4 bytes = 2^32 = 4,294,967,296
DNS: converts host names / domain namesinto IP#s
IPv6IPv6
-
8/8/2019 Java New Media com
148/155
Copyright 1997 Alex Chaffee
IPv6IPv6
aka IP: the Next Generation
16-byte addresses
2^128 =340,282,366,920,938,460,000,000,000,000,
000,000,000
No Y2K problem: InetAddress Class hidesimplementation
Sockets and PortsSockets and Ports
-
8/8/2019 Java New Media com
149/155
Copyright 1997 Alex Chaffee
Sockets andPortsSockets andPorts
Port: a meeting place on a host
one service per port
1-1023 = well-known services1024+ = experimental services, temporary
Socket: a two-way connection
Sockets and Ports (Diagram)Sockets and Ports (Diagram)
-
8/8/2019 Java New Media com
150/155
Copyright 1997 Alex Chaffee
Client
Sockets andPorts (Diagram)Sockets andPorts (Diagram)
port 13
port 80
Time Service
Web Service
Socket
Server
Socket
WellWell Known PortsKnown Ports
-
8/8/2019 Java New Media com
151/155
Copyright 1997 Alex Chaffee
WellWell--KnownPortsKnownPorts
20,21: FTP
23: telnet
25: SMTP43: whois
80: HTTP
119: NNTP
1099: RMI
TheWorld WideWebTheWorld WideWeb
-
8/8/2019 Java New Media com
152/155
Copyright 1997 Alex Chaffee
TheWorldWideWebTheWorldWideWeb
Runs on the Internet
Uses HTTP protocol
Invented by Tim Berners-Lee (and a cast ofthousands)
URLURL
-
8/8/2019 Java New Media com
153/155
Copyright 1997 Alex Chaffee
URLURL
protocol://host[:port][/path/][file][#anchor]
http://www.javasoft.com/sfaq/index.html
http://www.javasoft.com/sfaq/ ftp://ftp.stinky.com/pub/java/course.zip
HTTPHTTP
-
8/8/2019 Java New Media com
154/155
Copyright 1997 Alex Chaffee
HTTPHTTP
port 80 default
Client:GETpath HTTP/1.0
Header: valueblank line
Server:HTTP/1.0 OK 200
Header: valueblank line
data
telnet demo again
HTMLHTML
-
8/8/2019 Java New Media com
155/155
HTMLHTML
Text file
Tags - markup commands embedded in
texte.g.
This is bold and this is
italics