Title: Java
1 Java
- E-Commerce
- Prof. Sheizaf Rafaeli
2What 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.
3Java Hype
- Java could surpass Windows as the software
platform with the world's largest base by the
turn of the 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!!"
4Thin 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
5 Client systems range from dumb terminals to
mostly autonomous PCs. Thin clients fall in
between. (Source Byte
Magazine)
6Why 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.
7How 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.
8Javas 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.
9How 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.
10How it works (3)
11Javas Promises
- Simple
- like and unlike C, C
- Object Oriented
- Distributed
- Robust
- careful at handling data types
- no pointers
- Dynamic
- adaptable
- Secure
- Portable, small
- no implementation-dependent aspects
- High Performance
- could be better
- still hybrid compile/interpret
- Multithreaded
12Javas 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.
13Java is not JavaScript
- Java is a full-fledged object-oriented
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. - Owned by Sun
- 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 server-side version of JavaScript. - Owned by Netscape
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 powerful combination.
14Applets
Applets vs. applications
15Anatomy of an Applet Reference
ltapplet codeFilename.class heightnumber
widthnumbercodebaseDirectory_containing_applet
alignsetting hspacenumber vspacenumbernamestr
inggt ltparam namename1 valuevalue1gtltparam
namename2 valuevalue2gtlt!-- Define alternate
content, for non-Java browsers --gtltH2gtImagine an
impressive Java applet herelt/H2gtlt/appletgt
16Example
ltapplet codeScrollingNeonMessage.class
height200 width400 codebaseappletsgtltparam
nameMessageText value"Bookmark this
page!"gtltparam nameScrollSpeed
value10gtltH2gtBookmark This Page!lt/H2gtlt/appletgt
17Java 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?
18Microsoft 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
19Microsoft vs. Sun (2)
20How, where, by whom is Java used?
- Check out Suns report, at
- http//www.javasoft.com/nav/used/
- See JARS and GAMELAN
- C L experiment with office
- Wordperfect office suite?
- Net-It
21How, where, by whom is Java used? (2)
22Embedding 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
23Embedding a remote applet on your page
- ltAPPLET CODEClock2.class
Width170 Height150
CODEBASEhttp//mis.huji.ac.i
l/ttt/gt lt/APPLETgt - Try the applet on
- http//mis.huji.ac.il/ttt/java.lecture.html
- and on http//www-personal.umich.edu/sheizaf/try
java.html
24How to enable/disable JavaNetscape 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
25How to enable/disable JavaNetscape 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
26How to enable/disable JavaExplorer
- 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
27How to enable/disable JavaExplorer 4.x and 5.x
- Go to "View 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" - Restart the browser
28Sample IDE for Java online
- Try the online Java Web IDE at
- http//www.chami.com/webide/
- IBMs Visual Age for java
- Check out Symantecs Café, Visual Café Pro.
- Borland, Microsofts Visual J, Lotus
- Sybase PowerJ Metrowerks CodeWarrior
Inprise Jbuilder Supercede for Java
29Java Security?
- Javas sandbox security model
- Active-X trust model
- In any case, safe network computing is an
oxymoron - Orange Juice works better
30The 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
31Java Glossary and cheatsheets
- http//www.mindprod.com/gloss.html
- http//www.freewarejava.com/
- http//metalab.unc.edu/javafaq/javatutorial.html
- http//www.javacoffeebreak.com/
- http//java.sun.com/docs/books/tutorial/
- http//www.mercury.com/java-tutor/session01/sessio
n01.html
32The 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?
33Is 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
34A few more, and URLs
- Gamelan, JARS, Developer
- http//java.sun.com http//www.javaworld.com
- Best Java tutorial athttp//www.phrantic.com/sco
op/onjava.html - IBMs introduction to java, at
- http//www.ibm.com/java/education/intro/courseopti
ons.htm/ - Java in five minuteshttp//www.zdnet.com/produc
ts/garage/java/applet/ - Java in the future
- Windows, or OS/2 and hypercard?