Top Banner
1 E-Commerce: Java intro: Prof. Rafaeli Java Java E-Commerce E-Commerce Prof. Sheizaf Rafaeli Prof. Sheizaf Rafaeli
34

1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

1E-Commerce: Java intro: Prof. Rafaeli

JavaJava

E-CommerceE-Commerce

Prof. Sheizaf RafaeliProf. Sheizaf Rafaeli

Page 2: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

2E-Commerce: Java intro: Prof. Rafaeli

What is Java?What is Java?

A fundamentally new way of computing, based on the power of networks

Write once -- run anywhereWrite once -- run anywhere– 450 million vs. 120 million?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.

Page 3: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

3E-Commerce: Java intro: Prof. Rafaeli

Java HypeJava 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!!"

Page 4: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

4E-Commerce: Java intro: Prof. Rafaeli

““Thin clients”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

Page 5: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

5E-Commerce: Java intro: Prof. Rafaeli

Client systems range from dumb terminals to mostly autonomous PCs.

Thin clients fall in between. (Source: Byte Magazine)

Page 6: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

6E-Commerce: Java intro: Prof. Rafaeli

Why is Java important?Why is Java important?

With Java technology, the Internet and private networks become your computing environment.

Remote computing, thin clients, distributed Remote computing, thin clients, distributed control and accesscontrol and access

Java animates the Web, makes it interactive, Java animates the Web, makes it interactive, distributes content and power, and transforms distributes content and power, and transforms the internet and information systems.the internet and information systems.

Page 7: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

7E-Commerce: Java intro: Prof. Rafaeli

How it worksHow it works(in a web browser)(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.

Page 8: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

8E-Commerce: Java intro: Prof. Rafaeli

Java’s Secret: Java’s Secret: the Virtual Machine (VM)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.

Page 9: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

9E-Commerce: Java intro: Prof. Rafaeli

How it works (2)How it works (2)(in a web browser)(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.

Page 10: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

10E-Commerce: Java intro: Prof. Rafaeli

How it works (3)How it works (3)

Page 11: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

11E-Commerce: Java intro: Prof. Rafaeli

Java’s PromisesJava’s Promises

SimpleSimple– like and unlike C, C++like and unlike C, C++

Object OrientedObject Oriented DistributedDistributed RobustRobust

– careful at handling data careful at handling data typestypes

– no pointersno pointers

DynamicDynamic– adaptable

SecureSecure Portable, smallPortable, small

– no implementation-no implementation-dependent aspectsdependent aspects

High PerformanceHigh Performance– could be bettercould be better

– still hybrid still hybrid compile/interpretcompile/interpret

MultithreadedMultithreaded

Page 12: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

12E-Commerce: Java intro: Prof. Rafaeli

Java’s PerilsJava’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.

Page 13: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

13E-Commerce: Java intro: Prof. Rafaeli

Java is not JavaScript

Java is 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 sMostly 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.

Page 14: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

14E-Commerce: Java intro: Prof. Rafaeli

AppletsApplets

Applets vs. applications

Page 15: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

15E-Commerce: Java intro: Prof. Rafaeli

Anatomy of an Applet Reference

<applet code=Filename.class height=number width=numbercodebase=Directory_containing_appletalign=setting hspace=number vspace=numbername=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>

Page 16: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

16E-Commerce: Java intro: Prof. Rafaeli

ExampleExample

<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>

Page 17: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

17E-Commerce: Java intro: Prof. Rafaeli

Java applet restrictionsJava applet restrictions

Not too fast!Not too fast! Byte code, not compiledByte code, not compiled No (or limited) access No (or limited) access

to filesto files Applets have no Applets have no

memory-- they are memory-- they are stateless (however stateless (however secure servers allow secure servers allow bypass)bypass)

Limitations on number Limitations on number of sockets open of sockets open (connections)(connections)

How much of a How much of a closely held property closely held property of and by Sun of and by Sun Microsystems?Microsystems?

Page 18: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

18E-Commerce: Java intro: Prof. Rafaeli

Microsoft vs. Sun?Microsoft vs. Sun?

Scott McNealy vs. Bill Gates?Scott McNealy vs. Bill Gates? Sun thinks (hopes?)Sun thinks (hopes?)

that Java will be an that Java will be an alternative to Windowsalternative to Windows

Microsoft thinks otherwise…Microsoft thinks otherwise… Others now in the gameOthers now in the game

Source: Fortune Magazine

http://www.javasoft.com/lawsuit/index.html

                                                                  

Page 19: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

19E-Commerce: Java intro: Prof. Rafaeli

Microsoft vs. Sun (2)Microsoft vs. Sun (2)

                                                                  

Page 20: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

20E-Commerce: Java intro: Prof. Rafaeli

How, where, by whom is Java How, where, by whom is Java used?used?

Check out Sun’s report, atCheck out Sun’s report, at http://www.javasoft.com/nav/used/http://www.javasoft.com/nav/used/

See JARS and GAMELANSee JARS and GAMELAN C & L experiment with officeC & L experiment with office Wordperfect office suite?Wordperfect office suite? Net-ItNet-It

Page 21: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

21E-Commerce: Java intro: Prof. Rafaeli

How, where, by whom is Java How, where, by whom is Java used? (2)used? (2)

Page 22: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

22E-Commerce: Java intro: Prof. Rafaeli

Embedding an applet on your Embedding an applet on your pagepage

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

Page 23: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

23E-Commerce: Java intro: Prof. Rafaeli

Embedding Embedding a remotea remote applet on applet on your pageyour page

<<APPLET CODE=“Clock2.class” APPLET CODE=“Clock2.class” Width=170 Height=150 Width=170 Height=150 CODEBASE=“http://mis.huji.ac.il/ttt/”> CODEBASE=“http://mis.huji.ac.il/ttt/”> </APPLET></APPLET>

Try the applet on Try the applet on – http://mis.huji.ac.il/ttt/java.lecture.htmlhttp://mis.huji.ac.il/ttt/java.lecture.html– and on and on

http://www-personal.umich.edu/~sheizaf/tryjava.htmhttp://www-personal.umich.edu/~sheizaf/tryjava.htmll

Page 24: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

24E-Commerce: Java intro: Prof. Rafaeli

How to enable/disable JavaHow to enable/disable JavaNetscape 3.0Netscape 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

Page 25: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

25E-Commerce: Java intro: Prof. Rafaeli

How to enable/disable JavaHow to enable/disable JavaNetscape 4.x (Communicator)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

Page 26: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

26E-Commerce: Java intro: Prof. Rafaeli

How to enable/disable JavaHow to enable/disable JavaExplorerExplorer

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

Page 27: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

27E-Commerce: Java intro: Prof. Rafaeli

How to enable/disable JavaHow to enable/disable JavaExplorer 4.x and 5.xExplorer 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

Page 28: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

28E-Commerce: Java intro: Prof. Rafaeli

Sample IDE for Java onlineSample IDE for Java online Try the online Java Web IDE at:Try the online Java Web IDE at:

* http://www.chami.com/webide/http://www.chami.com/webide/ IBM’s “Visual Age for java”IBM’s “Visual Age for java” Check out Symantec’s “Café”, Visual Café Pro.Check out Symantec’s “Café”, Visual Café Pro. Borland, Microsoft’s Visual J, LotusBorland, Microsoft’s Visual J, Lotus Sybase PowerJ • Metrowerks CodeWarrior

• Inprise Jbuilder • Supercede for Java

Page 29: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

29E-Commerce: Java intro: Prof. Rafaeli

Java & Security?Java & Security?

Java’s “sandbox” security modelJava’s “sandbox” security model Active-X “trust” modelActive-X “trust” model In any case,In any case,

safe network computing is an oxymoron Orange Juice works better

Page 30: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

30E-Commerce: Java intro: Prof. Rafaeli

The 10 Java BuzzwordsThe 10 Java Buzzwords

Java Virtual MachineJava Virtual Machine HotJava, Appletviewer, HotJava, Appletviewer,

javac,. “Servlets”javac,. “Servlets” JDK, Java Development JDK, Java Development

kitkit JAR, zip, & Java BeansJAR, zip, & Java Beans ““Sandbox” vs. “Trust” Sandbox” vs. “Trust”

security modelssecurity models

AWT, Abstract AWT, Abstract Window ToolkitWindow Toolkit

ByteCodeByteCode JIT CompilingJIT Compiling .class, .java (source .class, .java (source

and bytecode)and bytecode) JDBC, Java Database JDBC, Java Database

Connectivity ODBC in Connectivity ODBC in JavaJava

Page 31: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

31E-Commerce: Java intro: Prof. Rafaeli

Java Glossary Java Glossary and cheatsheets and cheatsheets

http://www.mindprod.com/gloss.htmlhttp://www.mindprod.com/gloss.html http://www.freewarejava.com/http://www.freewarejava.com/ http://metalab.unc.edu/javafaq/http://metalab.unc.edu/javafaq/

javatutorial.htmljavatutorial.html http://www.javacoffeebreak.com/http://www.javacoffeebreak.com/ http://java.sun.com/docs/books/tutorial/http://java.sun.com/docs/books/tutorial/ http://www.mercury.com/java-tutor/http://www.mercury.com/java-tutor/

session01/session01.htmlsession01/session01.html

Page 32: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

32E-Commerce: Java intro: Prof. Rafaeli

The “Java backlash”The “Java backlash”

““It still does nothing” (?)It still does nothing” (?)Does the world really need programmable toasters?Does the world really need programmable toasters?

How long does it take to develop, load, run?How long does it take to develop, load, run? Will Microsoft succeed in busting the Will Microsoft succeed in busting the

“platform agnostic” monopoly buster?“platform agnostic” monopoly buster? Animation, interaction and dynamic content Animation, interaction and dynamic content

easier to achieve with DHTMLeasier to achieve with DHTML Is it truly slow, secure, portable?Is it truly slow, secure, portable?

Page 33: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

33E-Commerce: Java intro: Prof. Rafaeli

Is Java taking root?Is Java taking root?

In the browserIn the browser On the server (servlets)On the server (servlets) As commercial applicationsAs commercial applications In the arena of enterprise applicationsIn the arena of enterprise applications In teaching institutionsIn teaching institutions

For some bubble bursting and iconoclasm, see:For some bubble bursting and iconoclasm, see: http://www.disordered.orghttp://www.disordered.org

Page 34: 1 Java Java E-Commerce Prof. Sheizaf Rafaeli. 2 E-Commerce: Java intro: Prof. Rafaeli What is Java? n n A fundamentally new way of computing, n n based.

34E-Commerce: Java intro: Prof. Rafaeli

A few more, and URLsA few more, and URLs Gamelan, JARS, DeveloperGamelan, JARS, Developer http://java.sun.comhttp://java.sun.com http://www.javaworld.comhttp://www.javaworld.com Best Java tutorial at:

http://www.phrantic.com/scoop/onjava.htmlhttp://www.phrantic.com/scoop/onjava.html IBM’s introduction to java, at:

http://www.ibm.com/java/education/intro/courseoptions.htm/http://www.ibm.com/java/education/intro/courseoptions.htm/

“Java in five minutes”http://www.zdnet.com/products/garage/java/applet/http://www.zdnet.com/products/garage/java/applet/

Java in the future:Java in the future: Windows, or OS/2 and hypercard?Windows, or OS/2 and hypercard?