.NET Framework For Java Programmers
After reading this article Java programmers should be able to decipher and de-jargonize the .NET architecture and relate it with the proposed ECMA standard.
9 Javascripts you better not miss
This tutorial is aimed at those who have a working knowledge of Javascript. So the examples are not explained in great detail. Only the important parts are highlighted. I have presented 9 Javascript examples that I have found very useful while designing professional websites. There are many ways to implement these examples here. The code presented here is neither the shortest nor the most efficient. But it does work satisfactorily.
A high-performance, massively scalable P2P network
JXTA 2 is the second major release of the open source P2P
network building substrate with a popular Java-based reference
implementation. Significant design modifications have been
introduced to create higher performance, massively scalable,
and maintainable P2P networks. This article, which builds on
Sing Li's JXTA series Making P2P interoperable, published two
years ago, brings you up to date on the platform's major
changes.
Access USB devices from Java applications
The Java platform has traditionally prided itself on its
platform independence. While that independence has many
benefits, it makes the process of writing Java applications
that interact with hardware quite tricky. In this article, a
research scientist examines two projects that are making the
process easier by providing APIs through which Java
applications can make use of USB devices. While both projects
are still in embryo form, both show promise and are already
serving as the foundations of some real-world applications.
Advanced Text Indexing with Lucene
Lucene is a free text-indexing and -searching API written in
Java. To appreciate indexing techniques described later in this
article, you need a basic understanding of Lucene's index
structure. As I mentioned in the previous article in this
series, a typical Lucene index is stored in a single directory
in the filesystem on a hard disk.
alt.lang.jre: Get to know Jython
This article is the first in a new series, alt.lang.jre, introducing alternate languages for the Java Runtime Environment. Jython is an implementation of the popular scripting language Python, but running on a JVM. For Python developers Jython is the best possible entry point to the Java platform; for Java developers it may be the strongest incentive to learn another language.
An Introduction to Java Annotations
Make your development easier through the use of JDK5's annotation feature. The objective is to spend less time on unhandy code-writing and focus more on business logic rules.
Animation/Games in Java
Java can be applied to many uses. However, one of the most fun
applications of Java is to use it to create small animated
applets. In this series of articles I will show you how to
create animated Java apples. Some of them will be
non-interactive, such as a background animated display. Others
will be fully interactive, such as a video game. I will begin
from the very beginning and explain the basics of Java 2D
animation, and end the series with complex applet-based video
games.
Annotations in J2SE 1.5 (Tiger) - Part 2
A brief follow-up article on the support in Java for annotation
types. Annotations, which allow you to mark your code with
meta-tags, will be available in the upcoming Java release, J2SE
1.5 (also known as Tiger). Part two of a two-part article; this
part goes into more detail on the annotations capability.
Annotations in Tiger (J2SE 5.0)
Annotations, a new feature in J2SE 5.0 (Tiger), brings a much-needed metadata facility to the core Java language. In this first of a two-part series, author Brett McLaughlin explains why metadata is so useful, introduces you to annotations in the Java language, and delves into Tiger's built-in annotations. Part 2 covers custom annotations.
Better code testing with JUnit and FIT
The beauty of Framework for Integrated Tests (FIT) is that it enables the customer or business side of an organization to get involved in the testing process early (i.e., during development). Whereas JUnit's strength lies in unit testing during the coding process. This article shows you how to combine the best of FIT and JUnit for better teamwork and effective end-to-end testing.
Bluetooth boogies Java file transfer with JSR-82
The Bluetooth protocol stack lets you use several methods, including RFCOMM and Object Exchange (OBEX), to send and receive files between devices. Become familiar with the Java language library used to control a Bluetooth device and learn how to use JSR-82 API. OBEX is great way to send object data, context, and metadata about the payload.
Breathe intelligence into Java
Making AI work in your Java programs is easier than you think. This article covers some of those resources and examines the basic AI (artificial intelligence) concepts to show you how to create a smarter application.
CodeRuler: Medieval Java Training Game
If writing mudane Java code is giving you the blues lately, maybe it's time to turn your medieval fantasies into reality. You can rule your own kingdom while refining your Java programming skills and mastering the Eclipse development environment all at the same time. It's all in a hard day's work for a supreme CodeRuler. Simulation-gaming enthusiast Sing Li puts you on the fast track to ultimate kingdom domination.
Compressing and Decompressing Data using Java
Many sources of information contain redundant data or data that adds little to the stored information. This results in tremendous amounts of data being transferred between client and server applications or computers in general. The obvious solution to the problems of data storage and information transfer is to install additional storage devices and expand existing communication facilities. To do so, however, requires an increase in an organization's operating costs. One method to alleviate a portion of data storage and information transfer is through the representation of data by more efficient code. This article presents a brief introduction to data compression and decompression, and shows how to compress and decompress data, efficiently and conveniently, from within your Java applications using the java.util.zip package.
Dependency injection with AspectJ and Spring
Dependency injection and aspect-oriented programming are complementary techniques, so it's natural to want to use them together. This article shows you how to add some power to your programming by combining dependency injection of the Spring framework with aspects written using AspectJ.
Deploying Software with JNLP and Java Web Start
Delivering client-side Java technology-based programs has recently been a daunting task. Browser differences -- both in versions of the Java Runtime Environment (JRE) and security architecture -- have caused many developers to abandon rich client-side solutions in favor of using Java technology on the server, with JavaServer Pages (JSPTM) and servlets. But now that Java Web Start -- and the underlying Java Network Launch Protocol (JNLP) -- are a standard part of the Java 2 platform (as of version 1.4), it's far easier to deploy cross-platform, client-side systems. In this article, you'll take a look at what Java Web Start and JNLP are, learn how to use Java Web Start to run JNLP-packaged applications, and learn how to build and deploy your own.
Designing HotJava Views
This paper describes the design of the human interface for HotJava Views, a webtop user environment for a Network Computer. A Network Computer differs from the common Personal Computer in that it has no permanent local storage, but instead obtains its software and data as needed over the network from a central server. We have abandoned some characteristic features of current GUI interfaces, such as the desktop metaphor, file systems, and the distinction between applications and documents. Our design principles are focused on simplicity, clarity of the interaction model, and tight integration between applications.
Determining the Riskiness of Change
When bugs are inadvertently introduced into an application during performance tuning, it can significantly impact project schedules. Often the list of considered changes grows during the exercise, as you encounter unexpected problems in the code base. It is practically impossible to accurately schedule any kind of code restructuring unless you have some way of assessing the risks. Fortunately, help is available in the form of software metrics.
Embed Java code into your native apps
This article implements a solution that relies on a good understanding of the Unix APIs and robust software architecture. Embedding Java code into a Unix application developed in C or C++ can create problems related to GUIs or threads synchronization. In this article, Thierry Manfé implements a solution that relies on a good understanding of the Unix APIs and robust software architecture.
Extend the JDK Classes with Jakarta Commons, Part I
Explore the components in the Jakarta Commons set of reusable classes and you'll be convinced that most of them should be part of the JDK. Learn which ones you should use in your projects.
Fixing the Java Memory Model
JSR 133, which has been active for nearly three years, has
recently issued its public recommendation on what to do about
the Java Memory Model (JMM). Several serious flaws were found
in the original JMM, resulting in some surprisingly difficult
semantics for concepts that were supposed to be simple, like
volatile, final, and synchronized. In this installment of Java
theory and practice, the author shows how the semantics of
volatile and final will be strengthened in order to fix the
JMM. Some of these changes have already been integrated in JDK
1.4; others are slated for inclusion in JDK 1.5.
Functional programming in the Java language
If you work on large-scale development projects, then you're familiar with the advantages of writing modular code. Well-structured, modular code is easier to write, debug, understand, and reuse. The problem for Java developers is that the functional programming paradigm has long been implemented only via specialized languages such as Haskell, Scheme, Erlang, and Lisp. This article, shows you how to use functional programming constructs such as closures and higher order functions to write well-structured, modular code in the Java language.
Get Familiar with J2SE 5.0 Collections
Although you may be completely at ease with Java collections in previous versions, J2SE 5.0 collections are both simpler and different, requiring less code but altered programming techniques.
Groovy forever changes the way that you view Java
Whereas the Java language has won over an entire generation of programmers with its commitment to exactitude and extensiveness, Groovy heralds a new era of programming on the Java platform, one defined by convenience, expedience, and agility. This article shares an informal introduction to the proposed addition to the standard programming languages for the Java platform.
Groovy's growth spurt
Groovy took a gigantic leap this past April, with the formal release of a new parser aimed at standardizing the language as part of the JSR process. If you weren't paying attention before, now's the time to start. The new syntax is chock full of enhancements to the language designed for a short learning curve and a big payoff. Resident Groovy practitioner Andrew Glover walks through most important changes to Groovy's syntax and shows you a handy feat ure you won't find in classic Groovy.
Implement Your Own Proxy-Based AOP Framework
To help you understand and demystify AOP, this article shows you how to create a simple AOP framework using both JDK dynamic proxy and CGLIB. This framework supports declarative transaction management. This article uses Java 5 features, including annotations and generics. Since JDK dynamic proxy is simpler, this article starts with dynamic proxy.
Improve the run time of the Generic Log Adapter
Data collection is an important aspect of autonomic computing
problem determination and self-healing systems. This article
describes different techniques for writing efficient regular
expressions that form the basis for rules in the Generic Log
Adapter and discusses various issues with building custom
plug-in components.
JAR File Specification
JAR file is a file format based on the popular ZIP file format
and is used for aggregating many files into one. A JAR file is
essentially a zip file that contains an optional META-INF
directory. A JAR file can be created by the command-line jar
tool, or by using the java.util.jar API in the Java platform.
There is no restriction on the name of a JAR file, it can be
any legal file name on a particular platform.
Java 5 Unleash the Tiger on Your Next Project
Sun has let loose the Tiger. The next version of the Java platform was just released as Java 5 with many enhancements. What happened to 3 and 4?
Java certification success, Part 1 : SCJP
The SCJP exam is the first in a series of Java certification exams offered by Sun Microsystems, and for many it is the first step to becoming established as a competent Java developer. It tests the knowledge of Java fundamentals and requires in-depth knowledge of the syntax and semantics of the language. Even experienced Java programmers can benefit from the preparation for the SCJP exam. You get to learn very subtle and useful tips, which you might not have been aware of, even after many years of programming in Java.
Java Performance Myths Set Straight
Urban legends are kind of like mind viruses; even though we
know they are probably not true, we often can't resist the urge
to retell them (and thus infect other gullible "hosts") because
they make for such good storytelling. Most urban legends have
some basis in fact, which only makes them harder to stamp out.
Unfortunately, many pointers and tips about Java performance
tuning are a lot like urban legends -- someone, somewhere,
passes on a "tip" that has (or had) some basis in fact, but
through its continued retelling, has lost what truth it once
contained.
Java SE 6 First Impressions: A Desktop Winner
The desktop improvements focus mainly on user interface (UI) performance and native OS desktop integration. The core improvements focus mainly on improving developer productivity and Java application management. Sun's Mustang team also put significant effort towards Web services support and security improvements. Overall, whether you're an application developer, a system administrator, a tool vendor, or a security expert, Java SE 6 has something for you. This article presents some of the interesting new features I used in some more detail.
Java Theory and Practice: Testing with Leverage
In this final installment on testing of the three part series, Brian Goetz examines another technique for smoking out bugs that violate design rules: aspects. The first two installments in this series, Part 1 covering testing in integrated frameworks and Part 2 on testing with leverage, show how static analysis tools like FindBugs can provide greater leverage in managing software quality by focusing on entire categories of bugs rather than on specific bug instances.
Java Web Start to the rescue
On the client side, Java proves its viability with its ubiquitous availability on desktop and thin clients. In this article, Raghavan N. Srinivas introduces client-side deployment using several different Java technologies, with a particular focus on Java Web Start.
JDK 1.4 Supports Regular Expressions
Regular expressions have been around for a long time. They come in very handy for text processing tasks. Some attribute the success of Perl to its superb ability of handling regular expressions. While there have been third-party classes that support regular expressions, with JDK 1.4, Java provides native support via the java.util.regex package.
JDK 5.0: More Flexible, Scalable Locking
Multithreading and concurrency are nothing new, but one of the innovations of the Java language design was that it was the first mainstream programming language to incorporate a cross-platform threading model and formal memory model directly into the language specification. While this simplifies the development of platform-independent concurrent classes, it by no means makes writing concurrent classes trivial -- just easier.
JUnit nail-guns antipatterns
The advent of JUnit has been a boon to developers. Unfortunately, many think it's enough to learn the JUnit API and write a few tests in order to have a well-tested application. This idea is worse than not testing at all because it leads to a false sense of code health. Learning JUnit is the easiest part of testing. Writing good tests is the hard part. This article presents some common JUnit antipatterns and shows how to resolve them.
Jython for Python and Java developers
Jython is an alternate languages for the Java Runtime Environment. Its an implementation of the popular scripting language Python, but running on a JVM. For Python developers Jython is the best possible entry point to the Java platform; for Java developers it may be the strongest incentive to learn another language. This article introduces Jython and shows you what it can do to enhance your productivity on the Java platform.
Lazy Loading with Aspects
In this article you will discover how Aspect Oriented Programming with AspectJ can apply Lazy Loading to areas within an application. By using the simple example provided here to control when an object is loaded, you can apply lazy loading to your own applications wherever you feel it is required.
Migrating to Tiger: James Gosling and Mark Reinhold on Java 2 Platform, Standard Edition 5.0
As part of Sun Microsystems' effort to encourage the adoption of Java 2 Platform, Standard Edition (J2SE) 5.0, Tiger, we met with the father of Java technology, James Gosling, vice president and Sun Fellow, to get his take on how Tiger is doing. J2SE 5.0 stands out for its new language features, which includes generics, enhanced for loops, typesafe enums, variable arguments, static imports, and annotations. Is there an untold story here?
Mixing Java and Titanium: Part Three
This is part three of a three-part series on Java and Mac OS X from a Java programmer's point of view. This article takes a look at Cocoa from his side of the fence.
Monitoring Local and Remote Applications Using JMX 1.2 and JConsole
The latest release of Java, J2SE 5.0 (codenamed Tiger), formally adds support for the Java Management Extensions (JMX) 1.2. Russ Miles walks you through how to use the JMX support in J2SE 5.0, including the new JConsole application, to monitor and manage your own applications both locally and remotely.
More Enhancements in Java SE 6 (Mustang)
Version 6 of the Java Platform, Standard Edition (Mustang) contains a number of features that make programming with Java technology easier. In this article, we discuss four new features that allow you to do the following: Set file and directory permissions; Obtain the free space and usable space on partitions; Add Component objects to the tabs of a JTabbedPane; Use the popular SwingWorker class in conjunction with your Java Foundation Classes/Swing (JFC/Swing) applications.
More Java on Linux
Everyday more and more companies are looking at Linux as a means to lower their operational cost. Adding to your Java skills-set with a better understanding of Linux is a very good idea. Here is a brand new series of tutorials to help you learn Linux fundamentals. These eight tutorials cover the Linux kernel, file and service sharing, system customization and automation, and more.
Object Signatures
Avoid putting code in a frontline application that is specific to any specific implementation. The answer is to utilize the concept of wrappers. This is the seventeenth installment in a series of articles about fundamental object-oriented (O-O) concepts.
PHP & Java
The Java extension is an extremely exciting tool. By learning how to use this module, you can extend PHP by the power of all available Java classes. To show you the basics of the Java extension, this article will cover installation and a few code examples of using PHP and Java together.
Polymorphic Enums in J2SE 1.5 (Tiger)
Java version 1.5, currently referred to as Tiger, is due out around August 2004. Tiger introduces many dramatic new language features. This article further discusses the new enum facility, demonstrating how you can define enum constants polymorphically. You may want to first read the article Typesafe Enum: Using enum in J2SE 1.5 (Tiger).
Programming Neural Networks in Java
Programming Neural Networks in Java will show the intermediate to advanced Java programmer how to create neural networks. This book attempts to teach neural network programming through two mechanisms. First the reader is shown how to create a reusable neural network package that could be used in any Java program. Second, this reusable neural network package is applied to several real world problems that are commonly faced by IS programmers. This book covers such topics as Kohonen neural networks, multi layer neural networks, training, back propagation, and many other topics.
Reduce code bloat with XDoclet
The open source XDoclet code-generation engine, an integral
part of many leading Java frameworks, is often heralded as an
enabler for attribute-oriented programming and continuous
integration. But XDoclet also has an undeserved reputation for
being difficult for beginning developers to grasp and master.
Reduce Code Noise with Groovy
Groovy's concise syntax frees developers from typical Java constructs that are required for code compilation but don't facilitate expressing what a program is really trying to accomplish. In this revival of the Practically Groovy series, focus on the important aspects of coding as Groovy developer J. Scott Hickey walks you through a series of comparisons between the exciting language normal Java code and the same Groovy code.
Replacing Reflection with Code Generation
Java consultant Dennis Sosnoski wraps up his Java programming dynamics series by demonstrating how you can use runtime classworking to replace reflection code with generated code that runs at full speed ahead.
Standardized Enterprise Intergration? - Java Business Integration
JBI proposes to eliminate vendor specific integration solutions by defining a standards based Integration framework. This week Benoy Jose digs into this new JSR that is now in the early draft review stage.
Surviving Abrupt Shutdown
In many circumstances, you need a chance to do some clean-up
when the user shuts down your application. The problem is, the
user does not always follow the recommended procedure to exit.
Java provides an elegant way for programmers to execute code in
the middle of the shutdown process, thus making sure your
clean-up code is always executed. This article shows how to use
a shutdown hook to guarantee that clean-up code is always run,
regardless of how the user terminates the application.
Taming Tiger: Pre-release of Tiger now available
Sun has quietly released an alpha version of J2SE 1.5, also
known as "Tiger," and developer John Zukowski is in the big top
ready to start his Tiger-taming act. This new column picks up
where Magic with Merlin left off, detailing the changes to the
platform and providing examples for quick reference. In this
first article, John shows you where to get the pre-release
software and how to install it.
Tcl your Java apps
Enhance the customizability of your enterprise Java apps with Tcl scripting. In this article, Benedict Chng shows you how to embed Tcl scripting in your Java application to reduce your time-to-market and make your code remarkably easy to change and maintain.
The beauty of Framework for Integrated Tests (FIT)
Profiling is a technique for measuring where software programs consume resources, including CPU time and memory. This article provides a list of best-of-breed features you might look for in an ideal profiler and explains why aspect-oriented techniques are well suited to achieving some of those features. It also introduces you to the JDK 5.0 agent interface and walks you through the steps of using it to build your own aspect-oriented profiler.
The four most important books in your library do not have Java in their titles
Thomas Davis recommends four books that will provide you with what it takes to excel in Java development. The books extend beyond the basic syntax and semantics of Java to provide you with a comprehensive understanding of object-oriented programming.
The ins and outs of standard input/output
In this article you will learn the basics of standard input, standard output, and standard error. The mechanism uses devices for inputting and outputting data and still plays a role in modern GUI (graphical user interface) operating system.
The Sun Certified Web Component Developer 1.4 (SCWCD 1.4) Certification Exam
In March 2004, Sun Microsystems launched a new version of their existing Sun Certified Web Component Developer 1.3 (SCWCD 1.3) exam, which tests the web component development according to the latest J2EE 1.4 specification. The old version will co-exist and a separate upgrade exam will be made available soon. The Article details you about things you need to know for the new SCWCD 1.4 Exam.
Transfer Files From Anywhere with SRB and Jakarta
Storage Resource Broker (SRB) is a software platform that provides an interface for connecting heterogeneous data sources over a network. SRB is middleware designed to build data grids and access replicated data sets distributed over long distances. In this article learn how to mix SRB with the popular open source Jakarta Commons VFS and see how you can query and transfer files from anywhere.
Typesafe Enum: Using enum in J2SE 1.5 (Tiger)
Java version 1.5, currently referred to as Tiger, is due out around August 2004. Tiger introduces many dramatic new language features. This article discusses the new enum facility.
Unit test your Java code faster with Groovy
Not long ago, developerWorks contributor Andrew Glover penned an article introducing Groovy, a new proposed standard language for the Java platform, as part of IBM's alt.lang.jre series. Due to reader response, IBM decided to launch this column to offer a practical guide to using this hot new technology. This first installment introduces a simple strategy for unit testing Java code with Groovy and JUnit.
Use AOP to maintain legacy Java applications
If you've ever inherited and then had to maintain a Java-based legacy application, then this article is for you. Author Abhijit Belapurkar shows you how to use aspect-oriented programming (AOP) to gain an unprecedented view into the inner workings of even the most opaque of legacy applications.
User Code: Multiplexing Output Streams
The author has come up with a handy class for sending the same data to several output streams in Java. Here's how he did it.
Using Java to Control a Bluetooth Device
The Bluetooth protocol stack lets you use several methods, including RFCOMM and Object Exchange (OBEX), to send and receive files between devices. In this article, you become familiar with the Java language library used to control a Bluetooth device and learn how JSR-82 API and OBEX can be used to transfer files between the client and server.