This article will show
you how to create an
interactive,
graphics-based applet by
designing only the
graphical objects
themselves and by
specifying their behavior
given some external event
(i.e., a mouse click or a
button press). The ipl
and ipl.graphics classes
and interfaces will let
you design with both
notification and
interfaces, in order to
coordinate communication
between your graphical
objects and between the
graphical objects and the
display medium (i.e., a
canvas object). This
article will also show
you how to 'wire-up' your
interactive applet to
buttons in order to give
the user control over
your graphical objects.
Consider an Internet
client that wants to
connect to a site which
allows access only to
trusted clients. Consider
a trusted client that has
access to the site.
Wouldn't it be great if
the trusted client could
relay the Internet
client's data to the
restricted-access site?
In other words, it could
act as a 'channel', or a
'router', for a
restricted site. This
article describes
JTRouter - a
multi-threaded Java
program that acts as a
tunnel for socket
communication between an
Internet client and a
remote server. JTRouter
allows a machine to
initiate as well as
accept Internet
connections in
independent threads. It
is a unique
implementation in that
both the client and the
server roles are
implemented in the same
process.
'Hi, everybody!' the
large programmer/teacher
announces as he bounces
into a class full of
aspiring Java
programmers. 'Welcome to
Java.' My name is John
Tabbone. I teach Java at
NYU's Information
Technologies Institute.
ITI is a professional
program and the students
who enroll in my course
typically have a diverse
skill set. The usual
makeup of a class
includes C++ programmers,
VB and PB developers,
Cobol/Mainframe people
and a few people whose
only programming
experience is seeing the
new Java commercials. We
run the gamut. But
beneath the variety of
technical backgrounds is
the common desire to
learn about Java.
The Java programming
language and platform are
revolutionizing the
development and
deployment of distributed
software. I believe that
the huge 'twitch' game
market (based on game
consoles and PCs) will
continue to grow, but the
largest market growth
eventually will be in
distributed games and
entertainment
experiences. With steady
improvements in runtime
performance, Java is well
positioned to be the
language of choice for
writing distributed
entertainment software.
The Observer Design
Pattern is among the most
useful for
object-oriented software
design. The JDK itself
makes heavy use of a
variant of this pattern
in the 1.1 AWT event
delegation model. The JDK
also provides a reusable
embodiment of the pattern
in the form of the
java.util.Observer
interface and the
java.util.Observable
class. If you've done
much serious Java
programming you've more
than likely had occasion
to use these classes.
The following questions
on JavaBeans were
recently asked of Andy
Nguyen, Senior Product
Marketing Manager,
Authoring and Development
Tools, Sun Microsystems,
Inc.
It is possible to create
a very attractive
look-and-feel prototype
of a Calendar-based
browser application in
JavaScript, but to
compete with tough-minded
mainframe legacy systems
such as MEMO requires a
highly functional and
scalable working
prototype to justify the
continued investment and
potential encapsulation
of a large mainframe
system.
By all accounts, 1996 was
the year of Java. In that
short year, Java made the
transition from a humble,
almost academic,
cross-platform computing
paradigm to becoming the
virtual center of the
Internet development
world. The introduction
of applets has helped
drive the move from
static Web pages to
dynamic client-side
processing.
Since Java's explosion
into the marketplace,
we've seen a flood of
development tools,
wizards and environments.
The heavy hitters in this
area seem to be Symantec
and Microsoft, with Café
taking the visual
approach to development
and Microsoft's Visual
J++ continuing
Microsoft's terrifically
successful line of
Development Studio
products.
Introduction With ever
increasing software
complexity, error
handling mechanisms
offered by programming
languages become more and
more important.
Traditional error
handling techniques such
as using global variables
to indicate an error
(errno in C), returning a
value that represents an
error or simply
terminating the program
resulted in difficult to
read and error-prone
code.
It is possible to create
a very attractive
look-and-feel prototype
of a Calendar-based
browser application in
JavaScript, but to
compete with tough-minded
mainframe legacy systems
such as MEMO requires a
highly functional and
scalable working
prototype to justify the
continued investment and
potential encapsulation
of a large mainframe
system.
Build Java Applications
Faster and Easier
Business today moves at
the speed of the
Internet. Corporations
are rapidly deploying
Intranets as the vehicles
for real-time
information. But for
professional developers,
the wide adoption of the
Internet has given rise
to a new challenge:
delivering high-quality
applications, with
limited resources, in a
short time. The demand
for information requires
developers to deliver
applications which reach
more users, on a
multitude of
heterogeneous platforms,
across global networks.
Introduction What if you
built a Web site and
nobody came? Or they came
once and forgot to check
in again to see all the
latest stuff you built?
One of the problems with
the Web is that it has
been hard to get people
to become regular users
of your site. You're
either on the Favorites
List or you're not. And
even if you're there,
there's no promise that
people will think to call
up your site each day.
Since the inception of
the Internet, there has
yet to be a topic as
controversial as
"Push". In
fact, it's hard to pick
up a trade journal that
doesn't talk about it.
So, without writing a
dissertation on the value
of "Push",
let's explore an
extension of this idea.
"Managed Push"
is a methodology that
lets everyone in the
information chain have
the tools, access and
security to obtain
enterprise-wide data
when, where and how they
need it.
Organizations are
implementing Internet
strategies to speed up
business cycles and gain
a leg up on their
competition. They are
relying on the Internet
"dial tone" -
or Webtone - to enable
global Web-based
computing and provide
them with the
capabilities to run their
day-to-day business
faster, smarter and
cheaper.
"Java is the
language of network
computing," said
Lawrence J. Ellison,
Chairman and Chief
Executive Officer of
Oracle Corporation.
Basically, there are two
main reasons as to why
Java is the language of
choice for network
computing:
What Is An Intranet? If
Intranets were made into
a movie it would probably
be called, "Honey, I
Shrunk the
Internet!" A simple
definition of an Intranet
is: bringing proven
Internet technologies,
such as Web servers, an
ubiquitous networking
protocol (namely TCP/IP),
and other Internet
protocols such as HTTP
(Hyper Text Transfer
Protocol), MIME
(Multipurpose Internet
Mail Extensions), SMTP
(Simple Mail Transfer
Protocol), etc., inside
the walls of your
company. Intranets can be
used for:
Today, Web database
publishing is an
important way to publish
information
electronically. It
actually combines the
advantages of two
important technologies -
database and the Web.
Standard database
interfaces such as
ODBC[1] (Open Database
Connectivity) are used to
provide an abstraction
layer so that application
programs can access data
in a uniform and
vendor-neutral way. ODBC
is a standard API
interface introduced by
Microsoft. Each database
requires a driver that
converts SQL calls into
the respective database's
native calls and then
performs the database
interactions. Currently,
there are many databases
that come with ODBC
drivers such as Oracle,
Sybase, MS SQL, etc.
Scientific and technical
software developers
require the ability to
"see" their
data and do their
analyses graphically
instead of, or in
addition to, numerically.
Exploration of large
datasets, display of
simulation results and
interactive steering of
computation all require
data visualization in
some way, shape or form.
For more than thirty
years of systems
development, the software
crisis has posed a
problem. Generally,
systems development
surpasses budgets and
time limits and is not
reliable. Worse still, it
doesn't satisfy users'
requirements.
Java was designed to have
all of the best features
of existing languages.
However, Java has no
concept of asynchronous
behavior. This is the
main reason the threading
mechanism is so important
and that concurrent
programming techniques
are evolving quickly to
the point where known
patterns, whose behaviors
are well understood, will
become an integral part
of the common Java
environment.
Design Patterns are
blueprints that describe
how to design class
structures and object
interactions to solve
commonly encountered
problems. A Design
Pattern can be as simple
as the practice of using
an interface to achieve
polymorphism and as
complicated as designs
used to solve intricate
concurrency problems.
Decisions The choice of
encryption technologies
is not always easy, but
fortunately there are
often several equally
good options. The first
step in choosing an
algorithm is knowing the
purpose to which it will
be applied. Is it to
ensure privacy,
integrity, authenticity
or to provide
non-repudiation? Will it
be used on a small amount
of data or files so large
that the encryption
process could result in
an unacceptable
processing delay? The
strength of an encryption
method is dependent upon
both the algorithm and
the key length and can be
understood in terms of
the computational
resources required to
break it. The longer the
key, the stronger any
given algorithm. It is
the value of the data and
the length of time it
must be protected that
determines the necessary
encryption strength. As
long as the value of the
data is lower than the
cost of breaking the
encryption, it is
adequately protected.
The emergence of the
Internet and other
distributed networks puts
increasing importance on
the ability to create
global software - that
is, software that can be
developed independently
of the countries or
languages of intended
users and then translated
for multiple countries or
regions. Javaª 1.1 takes
a major step forward in
creating global
applications and applets.
It provides frameworks
based on the Unicodeª 2.0
character set - the
standard for
international text - and
an architecture for
developing global
applications, which can
present messages,
numbers, dates and
currency in any country's
conventional formats.
Sun's vision of network
computing is a day when a
constant, seamless,
global connection - the
Webtone -- is accessible
anywhere at any time from
any device (from
smartcards to
supercomputers). To
realize this vision, Sun
provides the Webtone
foundation, enabling
customers to securely
develop for, deploy
across and manage global
corporate networks.
The process of designing
reusable object-oriented
software is one of the
hardest problems faced by
object-oriented software
designers. This is mainly
due to the fact that
different software
architectures have
different requirements.
However, design patterns
give the software
designer the ability to
reuse some successful
designs that have been
used in other projects
and have proved to be
successful. Thus, design
patterns help software
designers design
successful new software
by using prior successful
designs as a basis for
their new design.
It seems that there is an
increasing demand for
Internet based
applications. Every time
I turn on my television,
I see Internet-related
advertisements or
commercials ending with
"See us on the Web
at: http:// www.somebigco
mpany.com'." These
URLs actually refer to
other computers out there
in cyberspace. Each of
these computers has one
or more socket-based Web
Servers administering
connections, file
transfers and other
various duties. As the
Internet begins to play a
greater role in commerce,
the demand for Web
Servers or customized Web
servlets will grow.
Java programmers are
network programmers and
increasingly, network
programmers write
applications that need
encryption technology.
The Internet is like a
huge chat room. Not only
is it a worldwide
sniffable net, it's
developing its own unique
business infrastructure.
New virtual services are
required to provide the
confidence in business
transactions that has
been available through a
paper-based system. In
addition to privacy,
Internet commerce demands
digital forms of
signature, currency,
notarization, purchase
orders and receipts. Many
of the most important
Internet applications can
be created only with the
support of sophisticated
cryptographical
techniques. One of the
great things about using
Java is that it
potentially allows the
developer control over
both the client and the
server. New crypto
classes will allow
creation of applets that
can provide security
services within existing
browsers.
The emergence of the
Internet and other
distributed networks puts
increasing importance on
the ability to create
global software - that
is, software that can be
developed independently
of the countries or
languages of intended
users and then translated
for multiple countries or
regions. Javaª1.1 takes a
major step forward in
creating global
applications and applets.
It provides frameworks
based on the Unicodeª 2.0
character set - the
standard for
international text - and
an architecture for
developing global
applications, which can
present messages,
numbers, dates and
currency in any country's
conventional formats.
Automated testing is
essential to guaranteeing
quality in Java
applications with complex
GUIs. Examination of
newly available test
tools and harnesses
illuminates the manner in
which strategic choices
regarding testing need to
be related to the nature
of the software being
tested.
In JDK 1.1, no other new
feature is likely to have
more impact on Java
programmers than the
less-publicized inner
classes feature. It'll
change the way in which
Java programs have been
traditionally written.
The primary goal of this
feature is to provide the
ability to declare
classes within classes.
Java's support for
concurrency is sufficient
enough to achieve a wide
range of desired results.
While the primitives
provided are very
powerful, they can also
be easily misused and may
lead to unpredictable
behavior. It is well
known that in a
multithreaded
environment, due to the
lack of mature tools
available, the debugging
process could easily
modify the state of the
program being debugged.
Last month, I introduced
the terms types,
variables, classes,
objects and references.
If you understood the
examples and correctly
answered the test
question I provided at
the end of the article,
you're well on your way
to mastering the
essential concepts that
govern how all Java
programs work. If you
missed the article, look
for it on SYS-CON's Web
site at http://www.JavaDe
velopersJournal.com. This
month, I'm going to
concentrate on eight
tenets of Java
programming. These
tenetsare the
"truths" that
will guide you safely
through the darkest
complexities of Java
syntax as it relates to
assignments, casting,
constants and method
parameters.
The Internet has been
very popular in the past
few years. With its
popularity still growing,
increased demand for
Internet network software
has grown as well. One of
the greatest advantages
to developing Internet
software with Java is in
its robust networking
support built into the
core language. The
java.net package provides
us with classes
representing URLs, URL
connections and sockets.
Combined with the java.io
package, we can quite
easily write
sophisticated
platform-independent
networking (Internet)
applications.
What JavaPlan Delivers
The Java language and
Java applets have taken
the Internet by storm,
yielding interactivity on
Web pages in ways
previously never seen. To
date, however, Java has
not been applied to
larger scale development
problems, a result of a
concentration of effort
on Java front-ends, but
little by way of back
ends. A new acquisition
from Sun Microsystems is
setting out to change
that.
The evolution of Java has
been truly mind-boggling,
and quite unlike anything
we have ever seen before
in the computing domain.
Seldom does a day go by
without yet another
software vendor pledging
allegiance to the Java
paradigm. Today, few
among us will question
the power and flexibility
of Java. Still, one may
ask, "Can Java, by
itself, meet all our
needs?" The answer
to that question was
given indirectly by the
designers of the language
itself when they made
allowances for extending
the reach of Java through
a standard interface
utilizing native methods.
Java is a programming
language. Nothing
complicated so far. And
just like all other
computer languages, it
will not make a bad
programmer into a good
programmer. All the same
techniques picked up
while coding in, say, C
or C++, generally can be
applied to the same
program in Java. But what
happens if you're not
coming from an
experienced coding
background. You don't
have this wealth of
knowledge. Fortunately or
unfortunately, depending
on your side of the
fence, when it comes to
coding multimedia applets
many experienced
developers are back at
square one with the
novices. The problem is
that in pre-Web days, the
majority of programmers
never needed to worry
about image manipulation
procedures. But now, it
would be rare for a Java
programmer not to have
coded some sort of image
processing applet.
Whether it is displaying
a logo or animating a
series of images, the
problems that can occur
are the same. Granted,
unlike many other
languages, Java makes
displaying images very
easy, however, without
careful consideration,
the resulting applet /
application may look far
from professional.
Why Test Applets? Why do
we test an applet? What
are we trying to show
when we test? This
article is addressed to
the developer/tester,
someone who is testing
their own Applets.
Nonetheless, all but a
very few of the
observations and
techniques apply to the
problem of testing
someone else's code. The
largest difference is
probably the emotion upon
finding a bug.
"Variables have
types, objects have
classes." This
phrase, borrowed from the
Java Language
Specification, succinctly
answers several questions
that, judging by the
frequency of their
appearance in the Java
news groups, are a common
source of confusion for
many Java programmers. It
reinforces that variables
and objects are different
things and helps explain
why "casts" are
necessary, why Java
"constants" can
appear to be modifiable
and what it really means
for an argument to be
passed to a method
"by value".
This month, I'll begin
with some background
information that will
help those who are not
yet comfortable with the
terms types, variables,
objects, classes and
references to get up to
speed. Then, I'll present
a problem, based upon the
exam questions for Sun's
Java Certification
Program, that will test
your understanding of
references and objects.
Introduction Java
developers are constantly
becoming frustrated
because of unexpected
encounters with Java
security features. For
example, a recent posting
on
comp.langs.java.security
complained about
difficulties in being
able to open a network
socket with Java. After
reading the security
introduction in the last
issue of JDJ, it should
be clear that allowing
Web content to open
arbitrary network
connections on a
workstation is highly
undesirable. Not only
could this circumvent
existing security
mechanisms, such as
firewalls and IP
address-based access
control, but these
network connections would
appear to be initiated by
the user, which could be
embarrassing. Java
applets are deliberately
limited in their
capability in order to
protect users. Without
these limitations, or
some other protective
mechanism, they would not
be acceptable to
corporate users.
I took the advice of a
friend of mine and
steered clear of the
'normal' movie theaters
and went a little out of
the way to go to a DLP
movie theater. The
experience
There are 8,909 books
listed on Amazon.com with
the word 'Investing' in
the title; there are(!)
27,146 books with the
word investment in the
title. Without having lo
This book is an update of
an earlier version that
was written for SQL
Server 2000. It employs
the Murach approach of
dual pages that repeat
and enhance the concepts
Reviewers overuse the
phrase 'required
reading,' but no other
description fits the new
book 'Ajax Security'
(2007, Addison Wesley,
470p). This exhaustive
tome from B
In my many years of
programming, almost 20
years now, I have used
countless integrated
development environments
(IDEs). I have used
everything from a simple
text edi