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.
In the first part (JDJ, Vol. 2, Iss. 4) of our series, we discussed some
basic patterns: Waiter and Early Reply Threads. Using inner classes, a sample
Waiter pattern, called Operation, was implemented. In this article, I
continue with an in-depth look at synchronization and its extensibility. The
relationships between Inheritance and Synchronization will be studied in the
context of the Inheritance Anomaly. A new model, called Active Object, will
be introduced as a possible alternat... (more)
What lies behind Web services? Some say the answer depends on the power of
the language used in the implementation, in addition to known standards like
XML, SOAP, and WSDL. Developing Web services is hard since incorrect use of
the language can cause subtle and pernicious errors. What patterns and idioms
should we use for simplifying the development process?
In this first of two articles, I describe some of the proposed changes to
Java and show how they work together to make Java technology a more
expressive language for Web services development. In a later article I'll use
the ... (more)
In the first article of this series (WSJ, Vol. 3, issue 12), I described
generic Java and examined the issues involved in supporting variant generic
types in Java. That article also explained how generic variant types increase
the readability, maintainability, and safety of our code.
I examined the implications of using variance annotations in class and
interface type parameters for Web services and I demonstrated how the new
concepts allow a better abstraction and maintainability, retaining and
improving at the same time the static type safety of our code (code that is
checked ... (more)
Despite extensive development over many years and significant demonstrated
benefits, the object-oriented paradigm remains poorly formalized. Several
concurrent object-oriented languages have been designed and implemented based
on the concurrent object model. However, upon attempting to apply formal
techniques to a significant application, several well known shortcomings
actually impeded progress dramatically right at the outset.
In the second part of our series (JDJ, Vol. 2 Iss. 6), we defined the meaning
of the inheritance anomaly to describe the conflict between inheritance and ... (more)
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.
It is unreasonable to expect all Java programmers to be experts in concurrent
programming. Deciding if and when to use the concurrency mechanism is a
problem in itself, but once the decisi... (more)