This advanced web-based programming course focuses on java language and its professional development tools. Students, who are familiar with object-oriented programming principles but have no java experience, will learn to program in java, use eclipse ide, javadocs, junit, and other tools. The course also covers sharing code over a network using applets, servlets, java server pages, and java web start.
Download Distance Learning Java Programming with Object-Oriented Development on Docsity.com and more Slides Java Programming in PDF only on Docsity!
Java and the Web
Object Oriented Software
Development Using Java
Chapter 1
Introduction
• This is an advanced Web Based programming
course with an emphasis on the Java
language. Students are expected to be
familiar with object-oriented programming
principles, but are not expected to have any
experience in Java.
Why Java?
• This discussion, by James Gosling and Henry
McGilton, is an excellent introduction to the
Java language:
http://java.sun.com/docs/white/langenv/
• The next slide, from the introduction,
describes the motivation for switching from C
and C++ to Java.
The Software Developer’s Burden
“Imagine you're a software application developer. Your programming language of choice (or the language that's been foisted on you) is C or C++. You've been at this for quite a while and your job doesn't seem to be getting any easier. These past few years you've seen the growth of multiple incompatible hardware architectures, each supporting multiple incompatible operating systems, with each platform operating with one or more incompatible graphical user interfaces.”
Additional Emphasis
• This course will prepare students to work in a
corporate environment, and will therefore
require advance planning before creating
programs, use of an interactive development
environment, formal unit testing, and keeping
records of time spent on development. The
instructor was a software development
manager in Bell Labs.
Caution—Distance Learning
Distance Learning is not for everyone. This is a graduate class in software development, and the Web-based format requires that students be more self-motivated and self-sufficient than other forms of instruction. If you need “hand-holding,” please enroll in the classroom section.
The withdrawal/failure rate for this class averages about 20% for distance learning students, and about half of that for classroom students.
Web Documentation
A primary reference source for Java programming is the Sun web site at http://java.sun.com. Students will be expected to develop skill at using the materials on this site to support their programming.
Also critical for NJIT students are the materials at http://web.njit.edu The left side of that Web page contains a menu with a guide to using many of the technologies used in this course.
Technical support
Technical support is primarily offered by student to student help on Moodle. I monitor the technical support conference, and often offer suggestions. I do believe in limiting help for the following reason.
A student wrote; “ My project doesn't work yet. For a jobinterview, I'd like to get it working and show it as an application Icreated using java/Unix/Oracle .” What if this student could only do the project with extensive help, then got the job and could not perform the work?
Exceptions
• Most rules need exceptions. It is reasonable to
give a student precise help or even write the
code for them if the problem is very small
(such as a single line of defective code) or
exact precision is needed (such as the correct
JDBC string to connect to a database.)
Software Delivery Options
The next few slides give a brief description of the software delivery options that will be covered in this course:
Sharing applications on a server
Applets
Java Network Launch Protocol and Java Web Start
Java Server Pages
Java Servlets
Applets
• An applet is Java code that inherits from the
classes Applet or JApplet and runs on a Web
server such as the Apache Web servers on
web.njit.edu and harp.njit.edu.
• Typically, for this course you would put your
applet code in a sub-directory of your home
page and post a link to it at a specific
homework assignment in Moodle.
JNLP and Web Start
• The Java Network Launch Protocol, in
combination with Java Web Start, is a browser
independent way of sharing a Java application
(not applet) over a network and running it on
a client machine.
• There is a separate lecture in this course on
JNLP.
Java Server Pages
JSP allows you to embed Java Code along with HTML in a Web page and display it in a client browser. Just as you need a Web server like Apache to service applets, you need a Java Web Container like Tomcat to service JSP. This is a really simple technology, but the amount of code on a single page is usually quite limited, and JSP applications typically have many pages.
Java Servlets
Servlets are Java Programs that inherit from HTTPServlet. They are similar to applets, except that they are run from a Java container like Tomcat instead of a Web Server like Apache.
On the NJIT system, due to the large number of students independently using Tomcat, servlets must be in a directory called servlet or subdirectory of such a directory. Tomcat identifies a servlet by detecting that term in the URL that it is providing. That approach is generally discouraged in commercial use.