340 likes | 492 Views
Java. E-Commerce Prof. Sheizaf Rafaeli. What is Java?. A fundamentally new way of computing, based on the power of networks Write once -- run anywhere 450 million vs. 120 million?
E N D
Java E-Commerce Prof. Sheizaf Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
Java 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!!" E-Commerce: Java intro: Prof. Rafaeli
“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-Commerce: Java intro: Prof. Rafaeli
Client systems range from dumb terminals to mostly autonomous PCs. Thin clients fall in between. (Source: Byte Magazine) E-Commerce: Java intro: Prof. Rafaeli
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. E-Commerce: 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-Commerce: Java intro: Prof. Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
How it works (3) E-Commerce: Java intro: Prof. Rafaeli
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 Java’s Promises E-Commerce: Java intro: Prof. Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
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 Java is not JavaScript 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. E-Commerce: Java intro: Prof. Rafaeli
Applets Applets vs. applications E-Commerce: Java intro: Prof. Rafaeli
Anatomy of an Applet Reference <appletcode=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> E-Commerce: Java intro: Prof. Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
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? Java applet restrictions E-Commerce: Java intro: Prof. Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
Microsoft vs. Sun (2) E-Commerce: Java intro: Prof. Rafaeli
How, where, by whom is Java used? • Check out Sun’s report, at • http://www.javasoft.com/nav/used/ • See JARS and GAMELAN • C & L experiment with office • Wordperfect office suite? • Net-It E-Commerce: Java intro: Prof. Rafaeli
How, where, by whom is Java used? (2) E-Commerce: Java intro: Prof. Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
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://www-personal.umich.edu/~sheizaf/tryjava.html E-Commerce: Java intro: Prof. Rafaeli
How 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 E-Commerce: Java intro: Prof. Rafaeli
How 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 E-Commerce: Java intro: Prof. Rafaeli
How 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 E-Commerce: Java intro: Prof. Rafaeli
How 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 E-Commerce: Java intro: Prof. Rafaeli
Sample IDE for Java online • Try the online Java Web IDE at: • http://www.chami.com/webide/ • IBM’s “Visual Age for java” • Check out Symantec’s “Café”, Visual Café Pro. • Borland, Microsoft’s Visual J, Lotus • Sybase PowerJ • Metrowerks CodeWarrior • Inprise Jbuilder • Supercede for Java E-Commerce: 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-Commerce: Java intro: Prof. Rafaeli
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 The 10 Java Buzzwords E-Commerce: Java intro: Prof. Rafaeli
Java 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/session01.html E-Commerce: 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-Commerce: Java intro: Prof. Rafaeli
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-Commerce: Java intro: Prof. Rafaeli
A few more, and URLs • Gamelan, JARS, Developer • http://java.sun.comhttp://www.javaworld.com • Best Java tutorial at:http://www.phrantic.com/scoop/onjava.html • IBM’s introduction to java, at: • 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-Commerce: Java intro: Prof. Rafaeli