Download presentation
Presentation is loading. Please wait.
Published byJoseph Copeland Modified over 7 years ago
1
Applications Active Web Documents Active Web Documents
2
Introduction Active documents consist of code executed on computer running browser Java language allows development of active document programs Programs called applets Platform independent Secure Active Web Documents
3
Continuous Update: Server Push
Some servers will send new versions of document: server push. Or clients may request new versions periodically: client pull. Each push or pull requires dedicated server resources. May not scale with number of clients. Also requires network bandwidth for each update. Active Web Documents
4
Active Documents Shifts the responsibility for updates to browser client…computation on client now. Work scales with number of active documents on client Active document can, in fact, incur less server overhead than dynamic document Active Web Documents
5
Active Documents Requires programming language; what should that language look like? How should the language be represented for execution? Text, binary or compressed? Multiple implementations possible; standards necessary for coordination Active Web Documents
6
Active Documents Active Web Documents
7
Java Technique for writing, compiling, downloading and executing active documents Includes: Programming language Runtime environment Class library Active Web Documents
8
Java: Language Resembles C++ Characteristics: Object-oriented
Some C++ stuff removed or restricted Characteristics: High level, general purpose, object oriented Dynamic memory allocation Strongly typed, static type checking Concurrent Active Web Documents
9
Java: Runtime Environment
Interpretive execution - Java language compiled into bytecodes Automatic garbage collection Multithreaded execution Internet access Graphics Active Web Documents
10
Java: Portability Java must be platform-independent
Run-time environment clearly defined and has no implementation dependencies Bytecode representation is platform independent Java Virtual Machine. (JVM) Active Web Documents
11
Java: Library Library provides collection of common functions for Java programs in the form of classes. Classes for: Graphics Low-level network I/O (socket-level) Web server interaction Run-time system calls File I/O Data structures Event capture - user interaction Exception handling Active Web Documents
12
AWT Graphics Java graphics library called Abstract Window Toolkit (AWT) Includes high-level and low-level facilities Windows with components - scrollbars, buttons Blank rectangular area with object drawing Run-time environment implementation maps AWT functions to window system-specific functions. Active Web Documents
13
Java Programs Two types of Java programs:
Stand alone Java programs. Java applets. What does a Java standalone program look like? How is it compiled & run? Active Web Documents
14
Compiling Java Programs
javac translates Java source code into bytecodes Checks for correct syntax Imports classes from library Writes bytecode program to filename.class Other development environments exist May include source code management Active Web Documents
15
Java Applets Java applet is compiled in the usual way: javac filename results in filename.class. filename.class is put in HTML file and run. An applet is run using an appletviewer or a browser. E.g. appletviewer filename.html. An applet has a panel associated with it. Java applet has a method init() to initialize the panel associated with it. Active Web Documents
16
Java & Browsers Browser must include Java interpreter
Java interpreter works through browser Graphics HTML Interpreter also works through native operating system File I/O Network operations Active Web Documents
17
A Java Applet Example Active Web Documents
18
Running Java Example <applet code="clickcount.class" height=150 width=400> </applet> Active Web Documents
19
Other Alternatives JavaScript VBScript.
Interpreted scripting language Like csh for browser VBScript. Other languages compiled into Java bytecodes. Other programming technologies - Inferno Active Web Documents
20
Active Web Documents
21
Summary Active documents execute code in browser on user's computer
Java is most widely used active document technology Java consists of: Programming language Run-time environment Class library Tags in browser for Java program invocation Active Web Documents
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.