Download Java intro CN PPT

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Java
E-Commerce
Prof. Sheizaf Rafaeli
1
What is Java?

A fundamentally new way of computing,

Based on the power of networks

Write once -- run anywhere
– 450 million vs. 120 million?

With Java technology, you can use the same application on
any kind of machine -- a PC, a Macintosh computer, a
network computer, a Ford car or a Krups coffee pot, or
even new technologies like Internet screen phones.
E-Business
: Java intro: Prof. Rafaeli
2
Java Hype



Java could surpass Windows as the
software platform with the world's
largest base by the turn of the
century. (which century?)
"All of you who have anything to do
with software development ignore JAVA
at your own peril"
" JAVA - TODAY THE WEB,
TOMMOROW THE WORLD!!"
E-Business
: Java intro: Prof. Rafaeli
3
“Thin clients”

Computers designed to be centrally-managed

Configured with only essential equipment

No CD-ROM, disk drives or expansion slots

Therefore lower in cost, esp.
Cost-Of-Ownership.
Net PC (Intel and Windows)
NC (Oracle and Sun)
Web TV
E-Business
: Java intro: Prof. Rafaeli
4
Client systems range from dumb terminals to mostly autonomous PCs.
Thin clients fall in between.
(Source: Byte Magazine)
E-Business
: Java intro: Prof. Rafaeli
5
Why is Java important?

With Java technology, the Internet and
private networks become your computing
environment.
Remote computing, thin clients, distributed
control and access
 Java animates the Web, makes it interactive,
distributes content and power, and
transforms the internet and information
systems.
6

E-Business
: Java intro: Prof. Rafaeli
How it works
(in a web browser)
References to java software
(applets) are embedded in HTML
The Java virtual machine first does stringent
security checks, and then runs the applet, which
appears and interoperates inside the browser.
E-Business
: Java intro: Prof. Rafaeli
7
Java’s Secret:
the Virtual Machine (VM)
Virtual Machine: a layer of software just above the CPU that
emulates a theoretical ("virtual") chip's behavior.
It hides--or Abstracts--the machine-level stuff into a single layer of
software.
The Java Virtual Machine, when properly implemented, allows a
Java application to run on the CPU for which the VM is written,
regardless of the type of system on which the Java programmers
worked.
E-Business
: Java intro: Prof. Rafaeli
8
How it works (2)
(in a web browser)
The computer's operating system
provides machine-specific support for
many of the actual operations and
interactions.
Result: The user gets an interactive Java
applet running in a browser. The Java virtual
machine serves as consistent platform on
different kinds of computers and operating
systems, so that the same Java applet runs in
browsers on PCs, Macs, UNIX, PDAs,
workstations, Network Computers, and
elsewhere.
E-Business
: Java intro: Prof. Rafaeli
9
How it works (3)
E-Business
: Java intro: Prof. Rafaeli
10
Java’s Promises

Simple

– like and unlike C, C++



Object Oriented
Distributed
Robust

– no implementationdependent aspects

– no pointers
Dynamic
– adaptable
High Performance
– could be better
– still hybrid
compile/interpret
– careful at handling
data types

Secure
Portable, small

Multithreaded
E-Business
: Java intro: Prof. Rafaeli
11
Java’s Perils

A native OS might offer features that Java can't use
without sacrificing cross-platform compatibility.

Interpreted Java byte-code doesn't run as fast as
complied native code.

If a program must interact with legacy code or data, a
more established tool or language might work better.

A developer may have superior tools for another
language or may be more productive using a familiar
tool or language.

A developer may not want to change, even if it costs
money and customers.
E-Business
: Java intro: Prof. Rafaeli
12
Java is not JavaScript




Java is a full-fledged objectoriented programming
language. Hybrid JIT
compilation to byte code.
can be used to create standalone
applications
Both client and server side, and
used much in stand-alone
embedded environments.

Interpreted, does not create
applets or standalone
applications

Mostly client side, but some
server software, (Netscape's
SuiteSpot), lets developers
write CGI programs in a serverside version of JavaScript.
Owned by Netscape

Owned by Sun
A Java-enabled browser is not automatically a JavaScript-enabled browser:
they require entirely separate interpreters (licensed from separate companies)
Rather than competing with each other, Java and JavaScript are a
E-Business
powerful combination.
13
: Java intro: Prof. Rafaeli
Applets
Applets vs. applications
E-Business
: Java intro: Prof. Rafaeli
14
Anatomy of an Applet
Reference
<applet code=Filename.class
height=number
width=number
codebase=Directory_containing_applet
align=setting hspace=number vspace=number
name=string>
<param name=name1 value=value1>
<param name=name2 value=value2>
<!-- Define alternate content, for non-Java browsers -->
<H2>Imagine an impressive Java applet
here</H2>
</applet>
E-Business
: Java intro: Prof. Rafaeli
15
Example
<applet code=ScrollingNeonMessage.class
height=200 width=400 codebase=applets>
<param name=MessageText
value="Bookmark this page!">
<param name=ScrollSpeed value=10>
<H2>Bookmark This Page!</H2>
</applet>
E-Business
: Java intro: Prof. Rafaeli
16
Java applet restrictions




Not too fast!
Byte code, not
compiled
No (or limited) access
to files
Applets have no
memory-- they are
stateless (however
secure servers allow
bypass)


Limitations on number
of sockets open
(connections)
How much of a
closely held property
of and by Sun
Microsystems?
E-Business
: Java intro: Prof. Rafaeli
17
Microsoft vs. Sun?
Scott McNealy vs. Bill Gates?
 Sun thinks (hopes?)
that Java will be an
alternative to Windows
 Microsoft thinks otherwise…


Others now in the game
http://www.javasoft.com/lawsuit/index.html
Source: Fortune Magazine
E-Business
: Java intro: Prof. Rafaeli
18
Microsoft vs. Sun (2)
E-Business
: Java intro: Prof. Rafaeli
19
C sharp (C#)

After settling its Java lawsuit with Sun Microsystems, Microsoft
announced a new set of software development tools and services
that will allow Java programmers to support Microsoft's new
software strategy.

Called Java User Migration Path to Microsoft.Net, or JUMP to .Net

Microsoft will also ship a tool that converts Java software code to C#
code. C# (pronounced "C-sharp") is a Java-like language that
Microsoft has created to compete against Java.
C# is an object-oriented programming
language. It aims to combine the computing
power of C++ with the programming ease of
Visual Basic. C# is based on C++ and
contains features similar to those of Java.
E-Business
: Java intro: Prof. Rafaeli
20
How, where, by whom is Java
used?
 Check
out Sun’s report, at
http://www.javasoft.com/nav/used/
http://industry.java.sun.com/javanews/more/success/
 See
JARS and GAMELAN
 C & L experiment with office
 Wordperfect office suite?
 Net-It
E-Business
: Java intro: Prof. Rafaeli
21
How, where, by whom is Java
used? (2)

E-Business
: Java intro: Prof. Rafaeli
22
Embedding an applet on your
page

You can find the applet.class files in your
browser's on-disk cache and copy them

To be used locally

Or on your own server
E-Business
: Java intro: Prof. Rafaeli
23
Embedding a remote applet on
your page
<APPLET CODE=“Clock2.class”
Width=170 Height=150
CODEBASE=“http://mis.huji.ac.il/ttt/”>
</APPLET>
 Try the applet on

– http://mis.huji.ac.il/ttt/java.lecture.html
– and on
http://wwwpersonal.umich.edu/~sheizaf/tryjava.html
E-Business
: Java intro: Prof. Rafaeli
24
How to enable/disable Java
Netscape 3.0

Go to "Options | Network Preferences..."
from the main menu

Change to the "Languages" tab To enable:
make sure "Enable Java" check box is
checked

To disable: make sure "Enable Java" check
box is unchecked

Restart the browser
E-Business
: Java intro: Prof. Rafaeli
25
How to enable/disable Java
Netscape 4.x (Communicator)

Go to "Edit | Preferences..." from the main
menu

Select "Advanced" panel To enable: make
sure "Enable Java" check box is checked.

To disable: make sure "Enable Java" check
box is unchecked. Restart the browser
E-Business
: Java intro: Prof. Rafaeli
26
How to enable/disable Java
Explorer

Go to "View | Options..." from the main menu

Change to the "Security" tab

To enable: make sure "Enable
Java
programs" check box is checked

To disable: make sure "Enable
Java
programs" check box is unchecked

Restart the browser
E-Business
: Java intro: Prof. Rafaeli
27
How to enable/disable Java
Explorer 4.x and 5.x

Go to "View (or Tools) | Internet Options..."
Change to the "Security" tab

Select "Custom" and click on the
"Settings..." button

To enable: make sure "Disable
Java" is
selected under "Java."
To disable: make sure a setting other than
"Disable Java" is selected under "Java." If
you're not sure which setting to choose, select
"High

safety"
E-Business
: Java intro: Prof. Rafaeli
Restart the browser
28
Sample IDE for Java online
Try
the online Java Web IDE at:
* http://www.chami.com/webide/
Try
JXXX Online Java compiler:
http://www.cybermeister.net/java/stepone.html
Check
out Symantec’s “Café”, Visual Café
Pro, IBM’s “Visual Age for java”.
Borland, Microsoft’s Visual J, Lotus
 Sybase PowerJ • Metrowerks
CodeWarrior • Inprise Jbuilder •
29
Supercede for Java
E-Business
: Java intro: Prof. Rafaeli
Java & Security?




Java’s “sandbox” security model
Active-X “trust” model
In any case,
safe network computing is an oxymoron
Orange Juice works better
E-Business
: Java intro: Prof. Rafaeli
30
The 10 Java Buzzwords





Java Virtual Machine
HotJava,
Appletviewer, javac,.
“Servlets”
JDK, Java
Development kit
JAR, zip, & Java
Beans
“Sandbox” vs. “Trust”
security models
AWT, Abstract
Window Toolkit
 ByteCode
 JIT Compiling
 .class, .java (source
and bytecode)
 JDBC, Java Database
Connectivity ODBC in
Java

E-Business
: Java intro: Prof. Rafaeli
31
Java Glossary
and cheatsheets
Try StepOne: http://www.cybermeister.net/java/stepone.html
 http://www.mindprod.com/gloss.html
 http://www.freewarejava.com/
 http://metalab.unc.edu/javafaq/javatutorial.h
tml
 http://www.javacoffeebreak.com/
 http://java.sun.com/docs/books/tutorial/
 http://www.mercury.com/java32
tutor/session01/session01.html

E-Business
: Java intro: Prof. Rafaeli
The “Java backlash”
 “It
still does nothing” (?)
Does the world really need programmable toasters?
 How
long does it take to develop, load, run?
 Will Microsoft succeed in busting the
“platform agnostic” monopoly buster?
 Animation, interaction and dynamic content
easier to achieve with DHTML
 Is it truly slow, secure, portable?
E-Business
: Java intro: Prof. Rafaeli
33
Is Java taking root?
 In
the browser
 On the server (servlets)
 As commercial applications
 In the arena of enterprise applications
 In teaching institutions
For some bubble bursting and iconoclasm, see:
http://www.disordered.org
E-Business
: Java intro: Prof. Rafaeli
34
A few more, and URLs

Gamelan, JARS, Developer

http://java.sun.com

Best Java tutorial at:
http://www.phrantic.com/scoop/onjava.html

IBM’s introduction to java, at:
http://www.javaworld.com
 http://www.ibm.com/java/education/intro/courseoptions.htm/

“Java in five minutes”
http://www.zdnet.com/products/garage/java/applet/

Java in the future:
Windows, or OS/2 and hypercard?
E-Business
: Java intro: Prof. Rafaeli
35