Jordan Anastasiade writes about Java Generics in JDK 1.5, and how they can help developers "to write general, flexible, and complex Web services where decoupling and reuse are very important goals, while retaining and improving static type safety."
- Posted by: Dion Almaer
- Posted on: December 02 2003 08:56 EST
"We've examined the issues involved in supporting variant generic types in Java. A key aim in introducing genericity and variance to the Java programming language is the desire to write general, flexible, and complex Web services where decoupling and reuse are very important goals, while retaining and improving static type safety. Furthermore, variance annotations in class- and interface-type parameters increase the flexibility of subtyping relationships, allowing a better abstraction and maintainability and optimizing Web services as later articles will demonstrate.
Generics increases the readability, maintainability, and safety of our Web services and will be introduced in the next release of the Java programming language (J2SE 1.5 Tiger code name). That release will also include JSR-201 with enumerations, autoboxing for loop enhancements, import of static members, and metadata - features that are easy to use as neither syntax nor semantic restrictions have been imposed on the original language. My next article will demonstrate how to us the JWSDP 1.2, JAX-RPC 1.1 with generics and some of the new features that will make our Web services safer and easier to develop."
Read: Optimizing Web Services Using Java, Part I - Generic Java and Web services
- Article: Java Generics in Web Services by Brian Miller on December 02 2003 12:51 EST
- Here we go again ... by romain Hippeau on December 02 2003 13:39 EST
- Generic arrays? by Michael Barinek on December 02 2003 18:21 EST
Don't waste your time reading the article. It only covers generics and reveals nothing about how to apply them to web services. What a missed opportunity.
This is part 1 of 3. The first article is probably just covering the basics.
The second part is indeed very good. It shows how to use generics in Java to build Web Services (JAX-RPC).
If you want to understand Generics in Java and how to use it for Web Services, you have to read both articles.
To those that remember the abuses of templates from C++.
The article and the title do not match, but reading the title made my spine shiver.
Because someone can do something does not mean they should. When templates were introduced to C++ developers started using them for everything. Templates do provide type safety at the expense of clarity, code bloat and eternal compile times and cryptic linker errors.
There are times when they are beneficial but it is a tool that is often overdone.
Templates do provide type safety at the expense of clarity, code bloat and eternal compile times and cryptic linker errors.
Web service developers who want type safety should use XML Schema and perhaps also JAXB, both of which have been available for years.
"Practically, you can parameterize classes, interfaces, arrays, and methods."
are you sure java 1.5 has generic arrays?