Atom Atom feed

Celtix + XFire = CeltiXFire?

A proposal is

I just saw this today while browsing the web:

Adinarayana Sakala: Project CeltiXfire is a SOA infrastructure framework focused on implementation of JCP and web service standards while also providing extensibility for legacy integration. It is a merge of two matured open source projects and communities, ObjectWeb Celtix http://celtix.objectweb.org) and Codehaus Xfire (http://xfire.codehaus.org). It will implement the JAX-WS, JAX-WSA, and JSR-181 standards. Core to this is support for web service standards like SOAP 1.1, SOAP 1.2, WS-I BasicProfile, WS-Security, WS-Addressing, WS-RM, and WS-Policy. This project will support several programming models like JAX-WS, JBI (ServiceMix), SCA (Tuscany), and CORBA services (Yoko).

I'm caught by surprise as I was subscribed to the Celtix devel mailing list and I haven't seen any traffic about the merger between Celtix and XFire there. It feels kind of one sided. Then again, everything that the Apache Software Foundation does these days is one-sided.

At any rate, whatever the outcome, I echo the sentiment of maomaode:

Celtix和Xfire即将合并,合并以后的名字将变成CeltiXfire

CeltiXfire这个名字太难听了,一点创意都没有 :(

肯定不如JBus来的好听吧。

有点专业精神好不好!

(translation) Celtix and XFire will merge to become CeltiXFire. CeltiXFire is such an ugly name to the ear. There is not a shred of innovative flavor to it. Definitely not as nice sounding as JBus. Have some professionalism, won't you?

[Update] It looks like the xfire-dev list was kept in the dark too.

Scheduling Algorithms for Procrastinators

It's a science now.

(Via Brian Hayes)

Michael A. Bender, Raphaël Clifford, Kostas Tsichlas: We are writing this sentence two days before the deadline. Unfortunately that sentence (and this one) are among the first that we have written. How could we have delayed so much when we have known about this deadline for months? The purpose of this paper is to explain why we have waited until the last moment to write this paper.

Joost: A Simple Networking Library

Today's OCI C++ lunch features Justin Michel presenting his own networking library—Joost. It abstracts away many of the lower level details and makes network programming simple and correct. The Joost abstraction retains only a few concepts: addresses, connections, events, messages. Hook them up and you've got a little thingy that will do the right things with little programmer attention. Things are done in an asynchronous fashion and nothing blocks. Flow control are handled through events.

The interfaces are carefully designed to make efficient implementations possible on multiple platforms and across programming languages. .NET and Java implementations have been done. C++ implementation is in progress.

Here's a snippet of client code:

class hello_client : public joost::tcp_events {
//...
public:
  void run() {
    joost::ip_address addr("localhost", 5555);
    joost::message_size_decoder_ptr no_msd;
    joost::tcp_events_ptr handler(this, dont_delete);
    joost::tcp_connection con(addr, no_msd, handler);

    std::string hello = "Hello World";
    joost::out_message out;
    out.append_uint8(hello.size() + 1); // size of string + 1 byte header
    out.append_ascii(hello);

    std::cout << "\nSending Hello..." << std::endl;
    joost::tcp_send_results result = con.send(out);

    std::cout << "\nDisconnection..." << std::endl;
    con.disconnect();
    hman.wait();
    std::cout << "\nDone." << std::endl;
  }

// ...
};

String 2006

A conference on string theory was held in the past weeks in Beijing.

(I know some readers of this blog are interested in string theory.)

Not Even Wrong: Slides from the talks at Strings 2006 are now available.

Steven Hawking is always a good read. And Edward Witten is always interesting.

Unreleated to the topic of the conference but equally interesting is the recent announcement of the full proof of the Poincaré Conjecture by Cao Huaidong and Zhu Xiping. It is one of the seven Millennium Prize Problems for which the Clay Mathematics Institute is offering a $1,000,000 prize for a correct solution.

Tags :

Bring Up The Windows XP System Properties Dialog Box

Use the Win+Pause key combination.

You may know this already, but the "Win+Pause" key combination (press the Windows Key (on keyboards that have it) and the Pause/Break key) will bring up the Windows XP System Properties dialog box, which I occasionally need to access to setup global environment variables.

I learned this trick while reading the Maven book that Trygve Laugstøl suggested. (BTW, the book is a pretty easy read. It's a free book but you have to give them your email address to download it. And they do a nice job of following up the download with several email inquiries.)

Tags :

You Know Your Laptop Is In Trouble...

...when your desktop icons show up in your Real Player's Message Center:

For those who don't use it, the Real Player Message Center usually features CBS news and new music videos.

A Messaging Standard Burst Onto The Scene

What's better—it's already working.

A while back, when I was researching the topic of SOA, several things struck me as odd. First, while everyone talks up web services (SOAP + HTTP), the actual success stories and case studies were all in CORBA or some such. Second, while everyone emphasizes the importance of messaging, the most popular messaging systems mentioned, at least under the ESB umbrella, are all JMS based.

Didn't these people knew, that JMS is only an API specification that does nothing at all to ensure interoperability? Plus it's a Java only solution.

Well, someone did know that this is a problem. And they are working on a new standard messaging protocol. (Via Middleware Matters.)

Who

What

Leading Organizations Join Forces To Develop New Messaging Protocol

The development of the AMQP specification is being driven by real-world, end-user demand for messaging infrastructure that is capable of integrating across various platforms, languages and protocols. AMQP is designed to be an effective means to create interoperability and unification of the messaging function because it is not reliant on specific implementations geared to individual platforms. The AMQP specification is also designed to interoperate with many of the current messaging and Web services specifications, including JMS, SOAP, WS Security, WS-Transactions, and many others, making AMQP an ideal messaging layer for use in Service Oriented Architecture (SOA). Further, AMQP is unique in that it provides an interoperable wire-level protocol, making it complementary to messaging application programming interfaces (APIs) such as JMS and useful in next-generation network infrastructure.

When

The AMQP specification is expected to reach version 1.0 within 18 months, at which time the Working Group will submit it to a standards body.

Why

"AMQP solves the 'missing middleware standard' problem." —John O'Hara, VP and Distinguished Engineer at JPMorgan

It is geared towards the financial services industry and is supposedly based on real-world working products. The down side of the announcement is that the final spec is still 18 months away.

[Update] InfoQ seems to have the most lively discussion about ADMQ right now.

Tags :

How To Turn A Yes/No Question Into A Four Way Choice

Courtesy of Eclipse.

Tags :

The Re-education Of A Ruby Brush-er-Off-er

It's a Perl. It's a Python.

I made it no secret that I did not buy all the Ruby hype, not when Curt Hibbs worked at OCI, not after attending Dave Thomas's and Bruce Tate's Ruby talks at NSJF, not when most of the Java developers around me started to go the the St. Louis Ruby User's Group meetings, and certainly not in front of my OCI colleagues, including our CEO.

CEO: How do you think of Ruby?

Me: I don't like it. Their (10x) productivity claim is ridiculous. They are trying to eat Java's lunch.

CEO: Mark will be doing an internal Ruby training event. Maybe you should attend and see it up close from your perspective.

So I signed up for the 18 hour (six evenings) training course on Ruby Programming. To be honest, my original intention was to go to the training event, raise a lot of noisy questions, and in general rip Ruby apart the best I can. Now that we are two thirds into the event, I can't say that's what I did. Maybe I'm too nice. Maybe I'm too chicken. Maybe the Ruby people does have a point.

What did I learn from taking the Ruby course? A few things. Let me enumerate.

The syntax

I still am not comfortable with the Ruby syntax. I understand them in class, but soon forget them afterwards. The language seems to be constructed to suit one persons taste. To me, C, C++, Java, bash, awk, Lisp, Basic, etc., have remember-able syntaxes, but Perl, Ruby, XQuery, XML Schemas, etc., have forgettable syntaxes.

Blocks

Everyone raves about blocks in Ruby. Some even put it up as the one differentiating feature of the language. After learning the syntax and coded a few examples, I can definitively say that blocks is no such thing. Yes you can capture the environment of the block. But you'd be crazy to design your library to mess around with the environment of a passed in block. So for normal use, blocks act much more like function objects in C++:

# Ruby
[1, 2, 3].each { |i| puts i }

// C++
std::for_each(vector.begin(), vector.end(), print_elem);

Meta-object model

We did not go into details on this one. However we touched upon the attr_accessor method on the Module class. With its help, the one line of Ruby code:

attr_accessor :foo, :bar

in a class's definition generates two instance variables @foo and @bar, plus getter and setter methods foo, foo=, bar, bar=.

(Notice how cute Ruby's setter syntax is. This line of code:

myObject.foo = 10

is actually a method call to the setter foo=. Another thing you have to think about when coding.)

This can be simulated in C++ with macros, but Java is powerless in this regard. If I have to pick one Ruby feature to explain all the hype, the meta-object model and the meta-programming that is enabled by it would be my choice.

With great power comes great confusion. Meta-programming is not an easy thing to learn and use. If indeed meta-programming is what makes Ruby so attractive, then there will be two kinds of Ruby programmers—the kind who does meta-programming, and the kind who doesn't. For the ones who doesn't meta-program, Ruby will be just like any other scripting language.

Dynamic typing, duck typing, open classes

Ruby's dynamic typing system is just like that of other scripting languages. There is nothing special here.

Ruby's duck typing feature is very similar to C++ templates. It can invoke a method on an object as long as a method with the same name and number of parameters is available.

Classes are open for modification. If I want to change the string class, I can. And my changes will be felt by all other classes in the same process. This is another dangerous sounding feature. However it has not caused any big problems in practice. It's just another thing that the programmer has to be careful about.

Rdoc, Gems, ruby-mode.el

Rdoc is like Javadoc.

Ruby Gems is a program that can automatically download Ruby packages from Internet code repositories and make it available on the local system. Just like Perl's CPAN. This is one feature that I like a lot about Ruby. Of course I've been advocating for years a system like this for Java, but nobody listened. JPackage.org and Maven comes close to the ideal, but one is tied to Unix, the other a build system.

Ruby doesn't have good IDEs that support refactoring. But at least there is ruby-mode.el so that I can indent my Ruby code properly. It can also auto insert the end markers that's so prevalent in Ruby (which is annoying.)

So how does Ruby stack up?

From a technical point of view, I saw very little that sets Ruby apart from the other scripting languages. It is practically another Perl. I also think Python could match Ruby feature for feature, including lambda support (blocks in Ruby) and meta-object model.

I will refrain from comparing Ruby with Java because they are in two different leagues. Java is a statically typed language while Ruby is dynamically typed. They serve different users, communities and purposes.

I have yet to hear a Ruby success story from a non-Ruby-enthusiast. I don't believe Ruby will succeed as a popular programming language. I do believe, however, that Ruby will be a potent tool for the meta-programming elite few. It will be the basis of their spectacular successes that nobody can duplicate. Kind of like that one guy who built a e-store system in Common Lisp and sold the company to Yahoo.

Google will buy a Ruby based product company this year for $40,000,000.

And it's not going to be me.

What about all the hype?

By hype we usually mean the loud reporting of something new in the technical press and blogs. For technical press, I have a very good explanation—that's their job. They are supposed to hype. They usually focus their hype for no more than three years, time enough for a nine month small project followed by a two year major project to succeed. Usually by the third year, a good technology will be standing on its own, and a bad technology will die off. Think applets which died, and servlets which lived.

However to take advantage of the media's hype, a technologies internal structure must be such that it can work with the media's hype cycle. It must continuously feed the media good material, either analysis or case studies. Think Free Software, which the media can't hype if they wanted too, and Open Source, which modified Free Software's stance so that the media can hype them.

Ruby was "discovered" by the pragmatic programmers when they went searching for a language to use in their pragmatic projects. And what did they do? They wrote a book. A bad one first, followed by a better one. What else did they do? They went on the conference circus telling the Ruby story to endless developers again and again. And that inspired people who experimented with it and liked it. What did they do? They made a fifteen-minute video of their web MVC framework product. The rest, as they say, is history.

Could someone else, just like the pragmatic programmers, have discovered something else like Python and did all the conference promotions? Of course it's possible. But nobody did. Could someone else promoted a Python based web MVC framework the way Ruby on Rails people did? Of course. The TurboGears people did just that. But clearly the socond comer does not have the same impact as the first comer.

What about Java?

As for Java, all I can say is that there is nothing in Ruby that directly competes with Java. The fact that Ruby people like to knock on Java is simply because Java is a fairly popular language. As DHH said once in an interview, he likes to poke at Java because he likes to see the reaction from the Java camp. He also said that he does not wish Ruby on Rails to go "enterprise."

However, Java can indeed learn something from Ruby. Here's my list of things that would make Java better:

  • Make Java open source, and quickly. Java 5 needs to be open sourced by the end of 2006. I have been saying this for years now. (And I promised to not talk about it anymore.)
  • All open source Java libraries needs to be made available, with dependency management, yum or apt-get style, from one single place (plus their mirrors.) No messy download and installation instructions.
  • Get things done more quickly. The slow pace of the JSR process is not fast enough for the technical press's hype cycle. It was not fast enough for the normal Java developers. Think the Groovy JSR.
  • The variously names jar file formats (war, ear, sar, bar, car, dar, far, gar, etc.) as well as the classfile format need to evolve into a single format. They are too confusing.
  • Improve the experiences of first time Java users. Let's not force them to define the JAVA_HOME environment variable. Let's not force them to learn about CLASSPATH and ClassLoaders.

Thank you for listening.

Tags :

Where Is My java.home?

A BeanShell script to find that out.

From time to time, I need to find out what my JVM thinks a certain system property is set. For example, the installation instructions of some software packages would say something like "put this file in the lib subdirectory of what your JVM thinks is java.home."

What I would usually do is to write a throw away Java program that prints out the said property. And of course you get tired of doing this tedious chore after a while. That's when you write a little script to do the work.

Here's my little script. It's call jenv, and it is written in the BeanShell scripting language:

[weiqi@gao]$ cat jenv
#!/usr/bin/env bsh

// Get all the system properties
props = System.getProperties();

if (bsh.args.length == 0) {
  // print them all
  for (name : props.propertyNames()) {
    print(name + "=" + props.getProperty(name));
  }
} else {
  outer_for:
  for (name : props.propertyNames()) {
    for (regex : bsh.args) {
      if (name.matches(".*" + regex + ".*")) {
        print(name + "=" + props.getProperty(name));
        break outer_for;
      }
    }
  }
}

It can be run anywhere a bash shell is available (Cygwin on Windows or Linux.) When this script is run bash delegates to another shell script called bsh passing the path name of the script file and any arguments. On Linux, my bsh script contains only the line:

java bsh.Interpreter "$@"

In Cygwin, since the file name passed to bsh is in Cygwin format, which Java doesn't understand, my bsh script has to do a little bit more:

#!/bin/bash
#
# Run the BeanShell command line interpreter
#
declare -a args
declare -i index

until [ -z "$1" ]
do
  if echo $1 | egrep -q '^/|^\.'
  then
    args[index]=`cygpath -a -w $1`
  else
    args[index]=$1
  fi
  ((index++))
  shift
done

java bsh.Interpreter ${args[@]}

The weird looking loop is there to straighten out any Cygwin path names to the Windows format so that Java can understand them. It's stolen from another script I've written.

Now that I have the scripts, finding out the values of system properties is as easy as finding out the values of environment variables. The command jenv by itself print out all system properties. If any command line arguments are supplied, they are used as regular expressions to filter the system properties. Only system properties whose name contains a substring that matches one of the regular expressions are printed.

[weiqi@gao]$ jenv user.home
user.home=C:\Documents and Settings\gao_w
[weiqi@gao]$ jenv user home
user.country=US
user.dir=u:\bin
user.variant=
user.home=C:\Documents and Settings\gao_w
user.timezone=
user.name=gaow
java.home=C:\Program Files\Java\jre1.5.0_07
user.language=en
Tags :

GNU grep's New Trick

Colored output mode and matching only mode are very useful.

I stumbled upon this Linux.com article: GNU grep's new features about a week ago. (No, the StumbleUpon Firefox plugin was not used.) I printed it out but only got a chance reading it on Thursday.

It talked about several new features in GNU grep 2.5 that's pretty neat. I've already used two of the features at work yesterday. But before I go on, let me see a show of hands, how many of you are using GNU grep 2.5? 2.4? 2.0? Right, chances are that you don't know or much care which version of grep you are using. I didn't know until I read the article. (I'm using GNU grep 2.5.1, which is a patch level behind the latest release. Must download, ./configure; make; make check; make install! ...Not! By the way, 2.5 was out in 2002—four years ago.)

The features I used are called --only-matching and --color. The --only-matching feature can also be specified using the -o option on the command line and it shows only the part of a matching line that matches PATTERN. The --color feature will show the matching portion of the line in color (by default red).

I find myself using the --color option to experiment with the regular expressions and then using the -o option to get the matching text for further processing:

[weiqi@gao]$ cat foo
This is a test.
[weiqi@gao]$ grep --color test foo
This is a test.
[weiqi@gao]$ grep -o test foo
test

For more complicated regular expressions, the color option gives a better visual feedback.

Give these new options a try.

Tags :

World Cup---Live, In ASCII Art, Through Telnet

How cool is that!

This has to be the coolest thing for a football watching geek: the World Cup is being broadcast live as ASCII art animation through telnet.

Go to telnet dedhost-075.sil.at 2006 and enjoy!

Tags :

JSF, Facelets, Seam At The JUG

The JBoss stack looks pretty good.

(My replacement DSL modem arrived from Speakeasy today. And it worked. Hurray!)

Tonight's St. Louis JUG meeting is again a very interesting one. Jay Meyer from Harpoon Technologies talked about Java Server Faces.

In stark contrast with the last JSF talk at the JUG 300 days ago, Jay's presentation is done from a Java web developers point of view. Having been to one too many JSF talks where the speaker can't seem to be able to extricate themselves from the JSF architecture diagrams for the first 30 minutes, Jay's straightforward approach of showing sample codes and talking very frankly about the advantages and shortcomings of JSF resonated with most of the over 40 Java developers in attendance. The interchange between the speaker and the audience members are very animated. Many good points were voiced by both the speaker and the audiences.

I will post a link the the presentation material as soon as it is uploaded to the JUG web site. However, my take away from this talk is this—Use Facelets, MyFaces, Seam, EJB3.

[Update] The presentation slides are here. Be sure to take a look at it. It's a fun one.


Other tidbits from the JUG:

In the Q&A session, I asked if anyone is using Maven. Only one or two people raised their hands. Raj Patel explained how he tried Maven and didn't feel comfortable about the extra things that Maven is doing to the project. Of the people who used Maven one asked "voluntarily?" On the other hand, when I asked about Ant, almost everyone raised their hands.


Someone asked the question about unit testing private methods. A long discussion ensued with Jeff Grigg suggesting that if you feel the need to test that particular private method then perhaps that method belongs to another class as a public method. I did not get a chance to say it, but my feeling is that private methods should be only unit tested through public interfaces.


Everybody is still looking for strong Java developers. For job opportunities at OCI see our careers page.


Oh, have I mentioned that I'm using Google Toolbar now. Its spell checking feature fits my way of blogging just right—now I can just click on the and do it in the editing text area.

Ubuntu 6.06 (Dapper Drake): First Impressions

Where's the JDK?

(My DSL is down again. Speakeasy will send a new DSL modem. I should be getting it tomorrow or Wednesday. So this blog won't be out in the world for a few more days.)

I downloaded and installed Ubuntu 6.06 (Dapper Drake) on my IBM ThinkPad T30 this weekend. The big motivator for me to try out Ubuntu is its sun-java5-jre packages as Mike Shuttleworth announced at JavaOne.

Here's my very brief experience report:

Ubuntu 6.06 has the least intimidating installation process I've seen. When you boot to the CD, the default action (after 30 seconds of waiting time) is to boot to the live CD and present the user with a working Gnome desktop, just like in an already installed Fedora Core 5 workstation. On the desktop is an "Install" icon.

Running the "Install" program doesn't at all feel like an operating system installation process, except the partion management part. (This will erase all data, are you sure you want to do it?)

Since everything is on one CD, after answering all the questions (username, password, date, time, etc.) I clicked on the OK button. When I came back a while later, everything is done. All I have to do is to reboot the machine.

Only the very basic programms are installed. The installation process insists on a minimum of 2GB hard disk space and 256BM swap space. The typical installation put 1.4GB of stuff on the hard drive.

Almost everything on my laptop worked: the wireless network card, the wired network card, the on board sound, and the video card. The USB stick worked too. The volume control buttons on the ThinkPad also worked: a little dialog scale thingy showed up when I pressed the buttons. The builtin dialup modem did not work out of the box.

The default power management setting for closing the laptop lid is "Blank Screen," which is not what I expected. I tried to change it to "Hibernate" but it had trouble hibernating. So I changed it to "Suspend," which seems to work.

Multimedia is always a struggle on Free Linux systems. Ubuntu has builtin support for the Ogg set of audio/video formats. MP3 and Flash is not installed. I search the web for "Ubuntu MP3 Flash" and got a bunch of Ubuntu 5 instructions. Since I'm not familiar with Ubuntu, I don't know which instructions to follow. With Fedora, there is a one stop shop where I can visit and execute a bunch of commands to get MP3, QuickTime, wms, Flash support. I know there should be something similar for Ubuntu 6.06. I just don't know where it is yet.

Finally, the Java support is almost an undocumented feature. After the big announcement at JavaOne, you would think that installing Sun Java5 JRE is a breeze. Again, maybe I'm not searching the web the right way. I can't figure out how to install the Sun JRE. I know somewhere in there the command "apt-get install sun-java5-jre" or "apt-get install sun-java5-jdk" are involved. Alas, there are configuration files that I need to edit before those command will do what I want.

If you know of a website where that information is spelled out, please let me know. Thanks.

Tags :

Joshua Bloch Shocking Confession: java.util.Arrays Is Broken

Are your program

(This should be all over the net by now. I first saw it here.)

Joshua Bloch: I was shocked to learn that the binary search program that Bentley proved correct and subsequently tested in Chapter 5 of Programming Pearls contains a bug. Once I tell you what the it is, you will understand why it escaped detection for two decades. Lest you think I'm picking on Bentley, let me tell you how I discovered the bug: The version of binary search that I wrote for the JDK contained the same bug.

The bug is in this line:

 6:             int mid = (low + high) / 2;

Once pointed out, it's obvious what the problem is. Joshua called on everybody to fix such broken code before they blow up.

The question is: how? The scope could be huge—it includes every line of code ever written and put into production. If you are thinking "That's the scope of the Y2K problem," you are exactly right.

Fellow programmers, we have a "Low+High" problem at our hands. Somebody better mobilize an army of "Low+High" special forces and get working.

Are your product "Low+High" compliant? :)

Google Notebook: I'll Use It!

This will be the death of del.icio.us.

It's been out for a while now, but today is the first time I heard of Google Notebook. It's a sticky-note type of application for the browser where the notes are saved on a server at Google. So I can create a note at work and go back home and read it.

One particularly nice feature of Google Notebook is that you can enable the "Note This" button. After enabling the button, every time you highlight a region on a web page a "Note This" button will appear near where your mouse is. Clicking on the button will automatically add the highlighted region to your notebook along with the title and a link to the page.

The "Note This" functionality is also available from the context menu.

For normal usage, the Google Notebook shows up as a small window in the lower right corner of the browser:

The small window can also be maximized to a whole page where more extensive editing can be performed. You can move your clippings around. You can edit the content of the notes. You can organize your notes into titled sections. You can also make your notebook public. Oh yeah, you can search your notebook and other public notebooks.

After 30 seconds of playing with Google Notebook, I'm pretty certain that I won't be tagging web pages in del.icio.us any more. I love the theory of the wisdom of the crowd and all. But come on, everybody knows their reason for tagging web pages is just so that they can come back to them later. Now that I can use Google Notebook to accomplish the same goal, there's no more reason to use del.icio.us anymore

Tags :

Bloglines Blog Search: I'll Use It

I just saw the announcement of Bloglines Blog Search

I gave it a try and am impressed with the search results. It's faster than Technorati, and more relevant than a plain Google search.

I admire their honesty in posting their hourly top queries uncensored (Do you think this will last long?):

(I also despair for the future of the species.)

Tags :

Ant Build Files Should Be Generated, As Should Project Files For IDEs

They should be generated from simple, easily editable description files

Ant wasn't around when I started my first Java project. We used Makefiles. We used elaborate Makefiles that are copied and tweaked from project to project. Cruft accumulates as time goes on. Until at one point, no one dared to touch the Makefile except between the lines:

# You can change these values
SOURCES=src/com/weiqi/client/*.java src/com/weiqi/server/*.java
CLASSES=classes

# You should not touch anything below this line

Then Ant came along. We threw away the Makefiles. I wrote my fair share of Ant build files. Some quite elaborate. The build files are in XML, which was cool new thing back then. It was also easier to read.

Then came the IDEs. They each has their own brand of project files that are generated when you start a new project, probably using the New Project Wizard.

The problem with project files is that they don't share that well. If you check them in to source control system and check them out on a different machine, it may not work. Even if it worked, they are prone to be modified while you are working on the project, which causes them to be checked back in, causing conflicts for everybody else.

Then there is Maven, which is a step forward from Ant build files. However its XML syntax is quite cumbersome and hard to remember.

Which brings me to MPC—The Makefile, Project and Workspace Creator. It generates Makefiles, Visual Studio solution files, and workspace files for other development environments from simple, human editable, comprehensible, and maintainable description files.

We use MPC for all of our C++ projects. And everyone loved it. You know the crowd, the C++ crowd. It's not easy for us to love anything. One benefit of using MPC is that one set of description files can be used to generate the files needed by multiple IDEs and environments: solution files for Visual Studio and Makefiles for GCC and Eclipse.

It saves time and hassle. That's why we love it.

Over the last two weeks, I've seen something similar in two different places, although on a smaller scale. The first place is Google Web Toolkit, where they provide tools to generate Ant build files and Eclipse project files. The second place is Celtix, where their wsdl2java tool has an option of generating an Ant build file.

What I would like to see is for this idea to spread to all Java projects in a generic way. I mean if you include in your tar ball an Ant build file, you surely have enough information to construct IDEA, Eclipse, NetBeans project files. That information, surely can be abstracted into something simple and easy:

// MPC file: myproject.mpc
project : hibernate_project, sprint_project {
  Source_Files {
    //list of sources
  }
  Mapping_Files {
    //list of mapping files
  }
  // etc.
}

From this file, we would generate project files for all sorts of IDEs and maybe Ant build files (maybe even Makefiles now that we don't have to maintain them):

[weiqi@gao] $ mpc.pl -type idea5 myproject.mpc
Generating idea5 output using myproject.mpc
Generation Time: 5s

[weiqi@gao] $ mpc.pl -type eclipse32 myproject.mpc
Generating eclipse32 output using myproject.mpc
Generation Time: 6s

[weiqi@gao] $ mpc.pl -type ant myproject.mpc
Generating ant output using myproject.mpc
Generation Time: 3s

[weiqi@gao] $ mpc.pl -type gnumake myproject.mpc
Generating gnumake output using myproject.mpc
Generation Time: 3s

What do you think?

Tags :