Skip to main content
View by: Most Recent | Topic | Community | Webloggers   
Monthly Archives:    

Blogs by topic: J2SE

• Accessibility • Ajax • Blogging • Business • Community 
• Databases • Deployment • Distributed • Eclipse • Education 
• EJB • Extreme Programming • Games • GlassFish • Grid 
• GUI • IDE • Instant Messaging • J2EE • J2ME 
• J2SE • Jakarta • JavaFX • JavaOne • Jini 
• JSP • JSR • JXTA • LDAP • Linux 
• Mobility • NetBeans • Open Source • OpenSolaris • OSGi 
• P2P • Patterns • Performance • Porting • Programming 
• Research • RMI • RSS Feeds • Search • Security 
• Servlets • Struts • Swing • Testing • Tools 
• Virtual Machine • Web Applications • Web Design • Web Development Tools • Web Services and XML 


J2SE

Mapping Design Intent to Code Chapter 3 in Fowler's UML Distilled discusses class diagrams. His first design concept: properties. Fowler describes the role of properties in OO design and how they are mapped to language features in Java and C#. In Java, a public read-write property can be mapped to a getter and setter pair. The design concept /** the name of this widget */...
on Jan 18, 2007
The requirements for defining an agent using the java.lang.instrument package have changed since I've done my first experiments with it for calculating the size of arbitrary objects three years ago. Many folks have asked me how to make that sample work with the final API and while I have told them the directions, they have not always succeeded in their task. So, here are the steps to build a...
on Jan 12, 2007
As genesis 3.0 is approaching Release Candidate, I decided to test it using the newly released Java SE 6. I ran the test suite and a single test failed, one involving script evaluation (I've blogged about genesis script support almost two years ago). Since JSR-223 was about to become part of Java SE 6, we've added support for it six months ago. By that time, either the test worked or it hadn't...
on Jan 11, 2007
The Rules of the Game This is just a Gedankenexperiment. I am not seriously proposing anything for Java SE7. A property is an abstract thing that has a get and set operation. A "native property" is a "property done right" with new syntax. A "JavaBeans property" is what it always was. I don't want to get into any syntax wars. I use an uppercase Pi (Π) to denote a...
on Jan 10, 2007
I had blogged on property boilerplate and the work of my graduate student Alexandre Alves in the summer, but I didn't get much reaction then. But recently, there has been a flurry of blogs on native property syntax. Let's try this again. Why Native Properties? Many programmers are sick and tired of boring, repetitive boilerplate code for JavaBeans properties. Here is a...
on Jan 7, 2007
I started to read http://www.netbeans.org/kb/55/beginning-jni-part1.html and soon realized that the article was for Windows while my main development machine is Ubuntu. OK, so it means that I don't need to install cygwin and the rest of the instructions in the article should work fine, right? (Un)fortunately, you need more than the difference in case you're a unixer (including Mac OS X). Here are...
on Dec 17, 2006
Java SE 6 final release is now available! My colleagues and I have blogged about Java SE 6 monitoring, management and diagnosability features in the past 1-2 years. This presents an overview of the monitoring, management, and diagnosability features in Java SE 6 and also serves as a starting point for you to find the relevant blogs/articles/documentation. Enjoy! Feature Brief Description...
on Dec 11, 2006
Can XML capture the Dependency Injection pattern ? Xml is a great language for describing structured data. But it works less well when people use it to describe control flow. Even worse when people treat it as a complete programming language (e.g.: ANT, XSLT) So my question is, does XML fit naturally when used to capture the dependency injection pattern ? Following the 'dependency...
on Dec 6, 2006
A Dynamic Language For BeanFactory A Dynamic Language For BeanFactory. One of the things I like the most about the Spring-IOC-container is its non-intrusiveness. I can write my classes, test them and then, only when I come to assemble them, use Spring. For this final step, I use the XmlBeanFactory (the most commonly used implementation of the BeanFactory) and write an xml file like...
on Nov 30, 2006
So, here is the deal. I've created a generic DAO class that looks like the following: <pre>package net.felipeal;import java.util.ArrayList;public abstract class DAO&lt;EntityInterface, EntityImpl extends EntityInterface> {    private final Class&lt;EntityImpl&gt; entityClass;    public DAO( final Class&lt;EntityImpl&gt; clazz ) {  ...
on Nov 22, 2006
I'm opening a small parenthesis in my thematic sequence of blog entries to talk about something I've just read on the Dr. Dobb's Portal. Looks like Sun is going to use GPL for the upcoming open source licensing of Java Standard Edition. I'm not going to discuss if it's the "best" license (personally I don't like it, but I understand that the choice has some strong rationale), but rather which is...
on Nov 8, 2006
I would like to start a discussion about XMLDecoder improvements. Some requests can be found in RFE 4864117. I don't want to discuss improvements of persistence delegation (XMLEncoder) here. How to read objects Usually the following code is used to read XML file that represents JavaBeans archive: public static Object[] readXML( InputStream stream ) {    List list = new ArrayList...
on Oct 31, 2006
[Update: changed wording per comments to fix error.] Dependency injection is pretty well established these days, with plenty of Inversion of Control containers available to manage your beans. I'm currently reading Java Concurrency in Practice by Brian Goetz et al, which got me thinking about the thread-safety of large object graphs managed by IoC containers. In most applications I've seen, the...
on Sep 21, 2006
I may have just experienced the easiest OS install of my life. I've been a long time Windows user, and I'm just now hoping to move completely away from that to Solaris or a Linux flavor. My employer recently provided me a new desktop from Sun Microsystems. It was supposed to have Solaris 10, but it was pretty much brain dead from the first boot. Multiple boot errors, incomprehensible messages,...
on Sep 19, 2006
This problem is not going away. We had to deal with it earlier this year with the Australians, and the U.S. is going to cause a problem or two next year as well. What's that you ask? The U.S. passed a law or two in the Energy Policy Act of 2005. Those lawmakers have to do something to earn their money. The laws affect how we observe daylight saving time (DST) beginning in 2007. I've posted a...
on Sep 14, 2006
If you are new to the concept, here's a refresher. Or if you prefer the layman's version: Let's say you want to have a lazily initialized singleton. Something like: public class Foo {    private static Foo _foo = null;        public static Foo getInstance() {        if (_foo = null) {     ...
on Sep 11, 2006
Back in May I blogged about simplifying my generics code with dot accessors to the type parameters, to simplify code that currently looks like this: public class FloydWarshall&lt;Node,                            Edge,      ...
on Sep 9, 2006
You remember that I once said that String's equal method just isn't enough sometimes. The reason is that the equal method just doesn't understand combining characters. Like it or not, the Unicode standard allows us to create equivalent text in multiple ways. Here's an example of how you can spell Michèle two ways: Precomposed characters: M i c h &egrave l e Combining sequences: M i c...
on Aug 23, 2006
If you are a returning reader, you're probably aware of the enum implementation I wrote for Java 1.4 almost three years ago. Running some Java 1.4 compatible code compiled with Java 5 has just called my attention to a supposedly low impact change that was implemented in Tiger. Since Java 5, a class literal, i.e., an expression such as MyClass.class does not trigger class initialization anymore....
on Aug 16, 2006
This probably isn't up to Click 'n' Hack's standards, but here's a fun little Java 5 puzzler for a Thursday afternoon. NOTE: For those in the dark, Click and Hack are really Neal Gafter and Joshua Bloch. They have a little skit they do at conferences where they present java code puzzlers. Alright, we've had Java 5 for a while now and have had a good chance to get up to date with our new language...
on Aug 10, 2006