The Source for Java Technology Collaboration
User: Password:



Malcolm Davis's Blog

June 2004 Archives


Groovy isn’t hip

Posted by malcolmdavis on June 29, 2004 at 11:01 PM | Permalink | Comments (11)

With a kind of weird cryptic syntax, it reduces the lines of code by making code less readable. Didn’t’ we learn our obscuring lesson with C? The beauty of languages like Python is not only the abstractness and easy of use, but also readability. Of course the creators of Groovy will rave about its virtues, and an ugly baby will always look beautiful to its mom, but this baby needs to be put to sleep.

If you’re looking for a higher level (more abstract) OO language, you might consider Jython, or look at the Bean Scripting Framework at Jakarta

Positive Note: I found Groovy’s flaws in a one-hour presentation, rather than several hours of playing around with the tool. A good reason to be at JavaOne.



Java Technology Concept Map

Posted by malcolmdavis on June 29, 2004 at 10:30 PM | Permalink | Comments (0)

The Concept Map is an interactive diagram that allows panning, zooming in and out, and resizing. Additionally, the diagram contains links to the technologies associated web page. [This feature makes it easy to find the tech web page.] There is also a quick index of the different Java technologies.

Interesting note: The map implementation is in Flash, and NOT JSF, Swing, or some other Java technology. :-(



Javapedia

Posted by malcolmdavis on June 28, 2004 at 10:23 PM | Permalink | Comments (0)

An encyclopedia of Java, javapedia allows everybody in the community to describe the parts of Java technology. The wiki mindset allows developers to get involved in the community by allowing the addition, editing and commenting of entries. For instances, authors and tools developers can add links from the technology described in javapedia to their efforts.

Javapedia is an opportunity to become involved in the community. If you don’t have time for a project, consider adding an entry for your favorite Java related technologies.



I'm ready!

Posted by malcolmdavis on June 20, 2004 at 09:34 PM | Permalink | Comments (0)

Any surprises?
In the last few months Sun has dropped a few bombshells. Sun has settled with Microsoft, changed strategy on hardware and announcing open source Solaris. What will Sun announce at JavaOne?

Vendors
It's difficult finding time for lunch and vendors. There are always great products that I rarely notice in publications, or products that I haven't had time to review.

Sun Engineers
Talking to Sun engineers is always fun. Craig R. McClanahan was just one of the many engineers available in the Sun venue last year. Engineers like Kohsuke Kawaguchi were also accessible at the conference. Kohsuke works on the XML and its schema languages, and is a great person to talk to if you are into XML. His main work is seen in JAXB RI and RELAX NG. Additionally, Kohsuke is a member of the OASIS RELAX NG technical committee and W3C XML Schema working group. Kohsuke's home page has some useful Schema & RELAX NG tools and techniques

Planning ahead
JavaOne has many things to offer. Even with the 8:30 a - midnight schedule, there just doesn't seem like enough time. Planning ahead can help. You can start at the JavaOne Catalog, or create a personalized schedule. There is also a JavaOne wiki. Hint: when trying to decide technical sessions, look at the speaker. The good sessions get locked out early. I showed up to a session 5 minutes early and the doors were already closed.

Parties
Missed them. Oh well, maybe I'll get invited this year. :-)



LAMP

Posted by malcolmdavis on June 14, 2004 at 09:10 PM | Permalink | Comments (4)

You would think with all the trash talk going on, its all about Java vs. C#, (or J2EE vs. .NET), and modern development process like refactoring. LAMP is often left out of many conversations. However, LAMP is a big contender for a share of the web market.

Many Mac owners might be familiar with DealMac. A grad student, who spent his time gathering info on Mac deals and then publishing his results on the web, started Dealmac.com. After considerable amount of effort he was able to make money off the data by redirecting traffic to vendor sites. Soon after DealNews was born, along with DealRam, DealCam, DealLink, and DealCoupon.

DealNews is one of those fortunate few that made it through the boom and bust days, and stayed profitable. DealNews is an ISP rack mounted solution, running LAMP. No complicated server configurations or high-end J2EE solutions. DealNews has a small staff, with a major development theme of “if it works, don’t fix it”.



toString() - any format recommendation?

Posted by malcolmdavis on June 10, 2004 at 05:30 PM | Permalink | Comments (10)

Many times the toString() format is dependent on how the developer wants to see the state. I've seen formats to accommodate Swing, console, the debugger, and log files. To help format Value/Transfer objects consistently, I use a utility method that employs reflections.

Use:
public String toString() {
    return ToString.format(this);
}

Sample output:  
[com.company.business.Address: Key=0, State=AL, Country=USA, City=Helena, Street=1313 MockingBird Lane, Zip=35000]

To mitigate issues with logging, I avoid carriage return and line feeds. To help differentiate embedded objects, the objects are enclosed with '[' and ']'.

[com....Customer: …, Address=[com....Address:…], Phone=[com....Phone:…],…,…] 
(where com... is short for the entire package path, com.companyname.business.etc..)

Any thoughts?



Simian

Posted by malcolmdavis on June 06, 2004 at 09:36 PM | Permalink | Comments (6)

A certain degree of copy and pasting occurs with every development project. The problem is many times overlooked, or missed during code inspection. Simian helps stop some of this monkey business by searching through text files (like Java and C#) and identifying duplications.

To do some testing, I ran Simian against a recent project. After running through 250K+ lines of code (LOC) in 20 seconds, Simian had found 47129 duplicate lines.

I guess you can expect some duplication with 250K+ LOC written by 10 developers in 10 months. Further investigation discovered many of the code duplications were in auto-generated sections. [Of course this makes you wonder about the code generation process]. Additionally, some of the dups found were over common coding variables usages in routines.

Simian seems to look for exact copies and not similarities. A more meaningful tool would be something that found algorithm 'similarities' in code. A more common problem with copy and pasting is when a developer copies a section code, then makes a minor mod. In the following example, the developer intended to have a common display format of the form of identifier + description.

Class Member
    public String displayText() {
        return "[ " + memberId + " ] " + name;
    }

Class Branch
    public String displayText () {
        return "[ " + branchId + " ] " + description;
    }

The developer copied the code and made a small mod. [Yes, this is a real world example.]

The concept is valid, and Simian does find many copy & paste problems. Simian helps automate the process by providing an Ant tag. Additionally there are plugins for Checkstyle and Eclipse. [I was able to get Simian to work in both 2.1 and 3.x of Eclipse.] Simian can be found at http://www.redhillconsulting.com.au/products/simian. Unfortunately, Simian is neither Open Source, nor free for commercial use. However, it is free for Open Source projects, and inexpensive to purchase for commercial.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds