1 1 Extreme Java G22.3033-007 Session 2 - Main Theme Java Tools and Software Engineering Techniques Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 2 Agenda Summary of Previous Sessions Java Platform Architectures, and Files Java Virtual Machine Traditional Java Tools Java Project Management Approach Readings Class Project & Assignment #1b
24
Embed
g22 3033 007 c21 - New York University · 2002. 12. 15. · 1 1 Extreme Java G22.3033-007 Session 2 - Main Theme Java Tools and Software Engineering Techniques Dr. Jean-Claude Franchitti
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
1
1
Extreme JavaG22.3033-007
Session 2 - Main ThemeJava Tools and Software Engineering Techniques
Dr. Jean-Claude Franchitti
New York UniversityComputer Science Department
Courant Institute of Mathematical Sciences
2
Agenda
Summary of Previous SessionsJava Platform Architectures, and FilesJava Virtual MachineTraditional Java ToolsJava Project Management ApproachReadingsClass Project & Assignment #1b
2
3
Announcements
Student accounts on i5.nyu.eduExtreme Java and eXtreme Programming (XP)Homeworks & Projects due datesGrader assignmentsJava IDEsJ2EE-Compliant Application ServersAssignment #2
4
Summary of Previous Sessions
Review Java’s Programming Language FeaturesCourse Logistics, Structure and ObjectivesEnterprise Software FoundationsApplication Performance EnhancementsLimitations of the Java EnvironmentClass Project & Assignment #1a & 1b
3
5
Part I
Java Platform and Architecture
6
Key Platform Features
ResourcesPackagingToolsEnvironmentOpen Source Solutions on the Java Platform:
http://jakarta.apache.org/
e.g., “regexp” regular expression package, “log4j”logging package, etc.
4
7
Java Platforms Architectures, and FilesRuntime Environment Architecture
Byte code verifierClass loaderRuntime Execution Engine / optimizerSecurity Manager (java.lang.SecurityManager) and API class files
Just-in-time compilerReduces byte-code interpretation and causes the executionworkload to shift to native compilation and caching of nativemethods.
Precompiler
6
11
Pre Java 2 Security
12
Java 2 Security
7
13
Java 2 Security
14
Part III
Java Tools
8
15
Traditional Java Tools
javacjarjavajavadocjdbappletviewer
16
Java Interpreter
Software that implements the JVM and runsJava applicationsStandalone or part of larger application(e.g., browser)Likely written in a native, compiledlanguageLoads Java class files and interprets thecompiled byte-code
9
17
Java Interpreter(continued)
Verifies compiled classes loaded fromuntrusted sourcesCan turn Java byte-code into nativemachine instructions (dynamic/JITcompilation)java [interpreter options] class name[program arguments]
18
Using “java”
Class should be fully qualified class name(including class package if any)Shouldn’t include “.class” file extensionSearches for the class in current class path(-classpath option)
10
19
Using “java”(continued)
Looks for main() methodmain method signature: public static void main( String [ ] myArgs )myArgs[0] is the first command line argumentNo need for argument count parameter (int argc= myArgs.length)
20
Class Path
Piece of environment information providinga list of places to look for some resourcesCLASSPATH: list of locations that can besearched for packages containing Java classfilesUsed by Java interpreter and compiler
11
21
Class Path(continued)
CLASSPATH includes directory names orthe names of class archive files (.zip or .jar)Use colon separator (UNIX), or semicolonseparator (DOS/Windows)Default paths:
Turns Java source code into a compiledclass containing JVM byte-code.java -> .classAllows one public class per file (file hassame name as class)Storing the class files in alternate directory:use -d option
12
23
Part IV
Java Applications
24
Type of Java Applications
Standalone Java applicationRuns independently
Applet (embeddable program module)Part of a larger applicationCompatible with mainstream browsers(Netscape, IE), and the Java appletviewer
JWS (Java Web Start) ApplicationsA component model for deployable clientsoftwareSubsumes the Applet component model
13
25
Java Web Start (JWS) Technology
See http://java.sun.com/products/javawebstart/Applications do not require a browser oncedownloadedFiles are cached on the clientChecks are performed with the web server to ensurethat the latest version of the application is being used(ZAC!)Built on top of Java 2 SecurityLinks point to JNLP files which syntax is defined aspart of a Java Community Process specification
Applet Plug-InNeeded for RSA signed applet verificationProvides enhanced applet debugging andmanagement featuresDownload JDK 1.3.1_01 which includes thelatest version of the Java Plug-in 1.3software
http://java.sun.com/products/plugin/
Consult the Java Plug-in documentationhttp://java.sun.com/products/plugin/1.3/docs/index.docs.htmlhttp://java.sun.com/products/plugin/1.3/docs/quick_start.html
Download the HTML converter 1.3.0_01http://java.sun.com/products/plugin/1.3/converter.html
Allows any Sun-Compliant JVM(implementing OJI) to become the defaultJVM for a browserSupports Applet, Embed, and Object tagsSupports Java-JavaScript bidirectionalcommunicationSupports RSA signed applet verification
Security FeaturesRSA signed applet (jar signing in the JDK)HTTPS (handled via browser)Liveconnect for Java-JavaScript bidirectionalcommunication
Origin of HTML page must be same as that of appletJavaScript must be signed and “UniversalBrowserRead”permission must be enabled for JavaScript (default is localJava policy)http://java.sun.com/products/plugin/1.3/docs/jsobject.htmlz
36
Java 2 Security
19
37
Java 2 Security(secure application distribution using Java cryptography API)
Secure Application DistributionApplications stored as a self-executing encrypted fileOnly class file data is encryptedMain executable file must be distinguishable
Four PhasesPackagingEncryption/DecryptionLoadingExecution
38
Part V
Packaging Java Applications
Also See Session 6 Handout on:
“How to Submit Projects in Zip or Jar Files”
20
39
Packaging: Java Archive (JAR) Files
Can compress with ZLIB compressionCan use pkzip to create and maintain JARfiles“jar” is the java archive utilityJAR file advantages: compression andaccess time
40
JAR Utility
See handout on how to submit projectsusing zip/jarjar -cvf jarFile path [path] […]jar -tvf jarFile [path] […]jar -xvf jarFile [path] […]Alternatives: Mobile Object and AgentsGUI Jar utility (MOAJar), etc.
21
41
JAR Utility (continued)
jar adds META-INF/MANIFEST.MFpacking list naming files along withcryptographic checksumsjar -cvmf myManifest.mf spaceblaster.jarspaceblaster
Use javakey to sign a JAR file (see digitalsignature / certificate)
42
Java 2 Security(secure application distribution using Java cryptography API)
Secure Application DistributionApplications stored as a self-executing encrypted fileOnly class file data is encryptedMain executable file must be distinguishable
Four PhasesPackagingEncryption/DecryptionLoadingExecution
22
43
Part VI
Java Project Management
Also See Session 6 Sub-Topic 1 Presentation on:
“Java Project Management”
44
Java Project Management ApproachRefer to the links on eXtreme Programming (seeunder “Announcements” on the course web site)See “Java Tools for Extreme Programming:Mastering Open Source Tools, including Ant, Junit,and Cactus” (Richard Hightower, Nicholas Lesiecki,ISBN: 0-471-20708-X, 11/2001)
Regression testing framework: http://www.junit.org/Ant build tool, and Cactus server-side unit testing:http://www.apache.org/
See the Sub-Topic presentation on Java ProjectManagement