# Presentation: 070758

## About Java and This Class

- Written by Jeff Smith
- Portions Borrowed From Publicly Available Information

## One NOAA -1

-  In 2002, the **NOAA** Program Review Team (PRT) concluded **NOAA** was not adequately structured to meet its current and future missions efficiently and effectively.
-  The PRT determined **NOAA** would be better served by moving from the existing Line Office structure to a more integrated structure, **one** that reflects the interdisciplinary and multidisciplinary nature of the challenges facing society.
-  ESRL was formed

## One NOAA -2

-  Our laptops won’t connect to any network disk location, making it difficult to share files
-  So in the spirit of One NOAA, I have created One yahoo email account we can use to send files to each other
-  name: corejava101@yahoo.com
-  password: onenoaa
-  I will use it to send you my solutions to exercises we work on in class
-  **One** NOAA, **one** ESRL, **one** email account for all of us...

## What is Java -1

**Java’s Origins**
- Originally codenamed “Oak”, the Java language was created and released by Sun Microsystems in 1995.
- The Java compiler creates one standard binary (bytecode) format for all operating systems. Thus you can compile your Java code on a PC and run it on a Linux machine or a Mac. This works because the Java bytecode runs in a Java Virtual Machine (JVM) or interpreter on each platform.
- Thus as new operating systems (OS) are developed, someone creates a JVM for it and your code will then run on the new OS!

## What is Java -2

**Java Development Kit (JDK) Major Milestones**
**JDK 1.0  ****	****Summer 1995**
**JDK 1.02 ****	****Jan 1996**
**JDK 1.1 ****	****Feb 1997 (Jeff Smith begins using Java!)**
**JDK 1.2 ****	****Jan 1998 (major improvements to JDK)**
- 		(this version is commonly referred to as Java 2)
**JDK 1.3 ****	****May 2000**
**JDK 1.4 ****	****Dec 2001**
**JDK 1.5        Sept 2004 **
**JDK 1.6        (code name Mustang, released later in 2006)**

## What is Java -3

**Versions of Java**
**J2EE - Java 2 Enterprise Edition**
- Contains all standard libraries, **plus** serverside Java--includes servlets, EJBs (enterprise Java beans), CMT, JMS, etc. Commonly used for web applications and distributed systems.
**J2SE - Java 2 Standard Edition**
- Standard version of Java with all standard libraries. Commonly used for applications and applets that run on a single machine.
**J2ME - Java 2 Micro Edition**
- Small footprint--stripped down version of Java that will run on machines (like cell phones) without much memory.

## What is Java -4

**Java and Javascript**
- Javascript is NOT a light version of Java. It is a client side (e.g. browser) scripting language which superficially looks like Java. It is very useful for web page development, but should not be confused with the Java language.
- Netscape made a great marketing decision in naming it Javascript so they could capitalize on the popularity of Java.

## What is Java -5

**Execution Environments**
**Applications - **standalone program which has a main() method (so it can run on its own).
**Applets - **Program that runs from within a browser or applet viewer
**Servlets - **Run in a J2EE container (like Tomcat) in a web server. JSPs (Java Server Pages) are special kinds of servlets.
**EJBs - **Heavyweight Java components that run in a J2EE container or application server (like JBoss)

## What is Java -7

**What is Swing and JFC?**
**Swing** is one application programming interface (API) out of the four API's in the Java Foundation Classes (JFC).  JFC contains the Swing API, the Accessibility API, Drag and Drop support, and the Java2D API.
- Swing provides a robust set of graphical user interface (GUI) components that are platform independent, and have a consistent look and feel across all platforms. Swing provides improvements over the old Abstract Windowing Toolkit (AWT), a previous generation GUI API for Java.

## What is Java -8

**What is SWT (Standard Widget Toolkit)?**
**SWT **is a new GUI library that is a potential alternative to Swing. IBM is a big advocate of SWT.
- SWT delivers native widget functionality for the Eclipse platform in an operating system independent manner. It is analogous to AWT/Swing in Java with a difference - SWT uses a rich set of native widgets. It access these native GUI features (e.g. Windows API) via the standard Java Native Interface (JNI).
- The main drawback is that it is not universally supported (like Swing). It does work in Windows, Linux, and Solaris however.

## What is Java -9

**What is JBoss?**
- JBoss is an open source developed application server for J2EE applications (your Java code runs within the JBoss environment).
- At the present time, JBoss has the largest market share, ahead of BEA Weblogic and IBM’s Websphere.
- Known for its ease of use, modularity and simplicity, JBoss is a powerful (and free) J2EE-based server.
- Apache Geronimo is also open source as is trying to overtake Jboss.

## What is Java -10

**What is Ant?**
- Jakarta Ant is the defacto standard tool for compiling Java projects and it is free. It can be invoked from the command line or integrated into an IDE like Eclipse. You can think of it as an improved version of the ***make ***utility.
- Currently, we are using Ant 1.51. To use Ant, typically you create a build.xml file which lists the files you want compiled and into which directories. When you launch Ant, it reads this file and compiles the project accordingly.
- Ant is a powerful and fairly easy to use tool which can used to automate a variety of scripting tasks. You can learn more at:
**http://ant.apache.org/index.html**

## What is Java -11

**What is Struts?**
- Struts is a framework for organizing and creating Servlet based websites. For example, if we rewrote WMS as a web application, we would use Struts.
- Struts is part of the Apache Jakarta Project (open source and free) and is rapidly becoming a standard for Java based web development.
- Struts employs a variation of the classic Model-View-Controller (MVC) design pattern (something we will cover later).

## What is Java -12

**What is JUnit?**
- JUnit is an open source (free!) regression testing framework used for conducting unit tests in Java. It is a fairly standard tool.
- Typically, a Java developer creates JUnit test cases while developing code (some developers even do it *before* they write the code). With the test cases written, a developer can easily run the regression tests each night before checking in any code (to verify that new bugs have not been introduced).
- You can learn more about it at **www.JUnit.org**

## What is Java -13

**A Word About Buzzwords**
- There are many Java related buzzwords and fancy *design patterns *(particularly in the J2EE world). Don’t be intimidated by this!
- The goal of program development is to write clear and concise code which is easy for other programmers to use, extend, and maintain. If you achieve this, you are a good Java developer, regardless of whether you know every buzzword or can list 150 design patterns off the top of your head.
- That said, it never hurts to see what design patterns (coding strategies) are working for other people. Other people ***occasionally*** come up with clever solutions to problems!

## Why Java? -1

- Runs on most operating systems without recompiling
- Future-proofs your code (your Java code will run on future Microsoft 64 bit operating systems)
- Program everything from servers to handheld computers (with J2ME)
- Similar syntax to C makes it easier for C programmers to learn
- Simpler and cleaner code than C++
- Networking is built into Java, making it easy to write socket daemons and utilities in Java

## Why Java? -2

- True object oriented language, maximizing code reuse (through inheritance) and minimizing development and maintenance time
- Enormous code base (libraries) exists to assist in the implementation of complex future projects
- Lots of Java developers available to hire
- Free development tools (JDK, Eclipse, Sun ONE Studio)
- Internationalization: The Unicode character set is an integral part of Java, making it easier to support warehouses in non-English speaking countries if WMS needs to be used in new markets.

## Why Java? -3

**Why Java? Java is Error Resistant**
- Java puts a lot of emphasis on early checking for possible errors, as Java compilers are able to detect many problems that would first show up during execution time in other languages.
- Java eliminates certain types of programming constructs in other languages that are prone to errors. For example, there is no pointer arithmetic that can go awry.
- Java automatically frees objects you create, using its garbage collector (no more memory leaks!).

## Why Java? -4

**Why Java? -- Good Multithreading Support**
- In Java, multithreaded programming has been smoothly integrated into it, while in other languages, operating system-specific procedures have to be called in order to enable multithreading.
- Multithreading is especially useful in graphical user interface (GUI),  network, and db programming. In db programming multiple threads can execute queries simultaneously (very useful on a multi-processor db server, like the servers we have in each warehouse).

## Why Not Java? -1

- There is a performance penalty for using bytecode instead of natively compiled applications. Early Java virtual machines (JVM) ran code very slowly compared to C/C++/Delphi. Current JVMs are much faster, probably on the order of 20% slower than native code. In most real world applications, this is negligible since most of the processing time is spent in database access or waiting for user input.
- Java isn’t suited for low level device programming (like video drivers) which require maximum speed and direct access to the hardware. C/C++/Delphi/Assembler are better suited for those tasks.
- You want to write relatively simple code to perform OS related programming (hence a UNIX shell script, DOS command script, or Ant script might be easier).

## Just Java 2 Book -1

**Just Java 2** by Peter van der Linden
- This is a good introduction to Java
- Core Java syntax and structure
- OOP concepts
- Threads
- File I/O
- Collections, Lists, etc.
- Networking
- Servlets and JSP
- Applets and Swing
- Security
- JDBC (Java database connectivity)
- XML

## Class Time / Structure

- I’ll strive to divide our classes up with 50% of our time looking
- and talking about slides and 50% of our time actually writing
- Java programs on the classroom computers.
- Our laptops have 1GB of RAM, so they should be
- good for running IDEs, Tomcat, etc.

## Java on the Web -1

- Sun’s Java Tutorial Pages
- http://java.sun.com/docs/books/tutorial/
- IBM’s Java Technology Zone (Developer Works)
- http://www-106.ibm.com/developerworks/java/
- TheServerSide.com (J2EE Community)
- http://www.TheServerSide.com
- Latest Java news, great interviews and threads on a number of different Java related technologies. Authors of several J2EE books add their two cents to many threads
- Find out some of the things about Java and J2EE that you won’t find on the “official” Sun website.
- Java Lobby (Community) at http://www.javalobby.org/

## Java on the Web -2

- Java on the Web -1

## Java Development at GSD -1

**WRF Portal – **Swing application front end for running WRFhttp://www.wrfportal.org
**Domain Wizard **Swing application front end for creating domains and running the WRF preprocessor http://www.wrfportal.org/DomainWizard.html
**RTVS rewrite **– Nick, Missy and Dan are developing the next generation of RTVS in Java
- AWIPS – Raytheon is rewriting AWIPS using an enterprise Java architecture
- STMAS viewer-AWT applet by Bill Moningerhttp://www-frd.fsl.noaa.gov/stmas/view
- FX/Net –Swing application, Evan and Jebb

## Questions For You

- What is your background with computers, programming, and Java?
- What do you plan to do in Java in the future?

## A Final Word -1

**Learning Java and OOP**
- Learning OOP will be an ongoing process
- For most people, it takes multiple exposures to OOP literature and instruction to “get it”. So don’t get discouraged if it takes a while! That is normal.
- OOP is pretty standard stuff. The terminology, concepts, and even the syntax are similar among Java, C++, C#, Object Pascal (Delphi), Python, and other OOP languages.
- The OOP and OOD (object oriented development) concepts you learn for Java will serve you well with other OOP languages too.