New Main-Class
A cool jar-file hack
In today's Weblogs, Laird Nelson offers up a Cheap Hack I: rename your jar file, get a different Main-Class. The hack is very cool - I love these kind of blog entries. He "put together a class that itself is installed as the Main-Class in a jar file, but which consults a file (also in the jar) to let it know what class to actually use as the main class. The hackish part is that all you have to do is rename the jar file for the "right" Main-Class to be selected." Check out the code he provides.
You have 30 seconds to explain your favorite piece of technology. Bob Lee chooses to deliver his AOP Elevator Speech. At its core, "AOP enables me to leave my form classes untouched and to fully decouple reusable functionalities. My form classes shouldn't care that I'm caching the validation result. With AOP, I can implement the caching logic in one module and apply it at runtime or build time to all of my forms or to other places that follow a similar pattern. Each new form I add will enjoy caching for free. I've gone from a constant maintenance effort to zero effort thanks to AOP. Plus, I have a lot less code to unit test."
In
Also in Java Today , in preparing for the Generics
chapter of "Thinking In Java, 4th Edition", Bruce Eckel has been
Puzzling Through
Erasure. He complains that if he has "a type parameter T, not
only am I prevented from making an instance of that type (because,
with erasure, the type is forgotten), I cannot make an array of
that type. However, I can generate an array of Object and cast it
to T[]." In other words, he wants to write something like
private T[] array= new T[sz]; But is forced instead
to use something like private T[] array= (T[])new
Object[sz];
Yakov Fain explores Java Gotchas: Instance Variables Hiding. Java newbies (and those stumped by unexpected behavior) should check out his piece that looks at overriding, hiding, and shading. "If methods with the same signatures or member variables with the same name exist in ancestor and descendant classes, the Java keyword super allows access members of the ancestor. But what if you do not use the keyword super in the descendant class? In case of methods, this is called method overriding and only the code of the descendant's method will execute. But when both classes have a member variable with the same name, it may cause a confusion and create hard to find bugs."
In Projects and Communities , the Java Enterprise community is featuring this resource on Getting Started with the J2EE Platform. The page includes links to download J2EE, to tutorials, and to resources such as the Blueprints pages.
James Strachan has announced ActiveSOAP "which is a pure StAX based implementation of the SOAP 1.2 protocol for implementing document centric Web Services and SOAP intermedaries."
If you want to get ahead on the next two bookclub selections, they are posted in today's Forums. In honor of the upcoming Tiger release, our next selection is Brett McLaughlin's "Java 1.5 Tiger: A Developer's Notebook" followed by Joshua Kerievsky's "Refactoring to Patterns". Each discussion will be led by the author.
On JSR discussions, Robilad writes "Some JSRs have very active, open communities outside the official JSR infrastructure, where the actual details of specifications seem to get hammered out. Given that participants to some of the fundamental modifications to the platform seem to prefer to meet outside the JCP infrastructure to discuss their ideas in the open, I'm wondering how well that reflects on JCP's current provisions to foster collaboration. Would a more liberal JCP be a better thing?"
In today's java.net News Headlines :
- JBoss Ships J2EE Compliant App Server
- Sun Wooing Wall Street with New Solaris
- Commons HttpClient 3.0 alpha2
- XOM 1.0b5
- Ganttproject 1.10.1
- ArgoUML 0.16.1
- FastParser 1.6.8
- JXP 1.3.3
- Microsoft Expands Government Access to Code
Registered users can submit news items for the java.net News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to thejava.net News RSS feed.
Current and upcoming Java Events :
- September 23, 2004 Chat with Sun's Chief Web Services Strategist
- September 23, 2004 Compuware OJX
- September 24-26, 2004 Michigan Java Software Symposium
- September 29-October 1, 2004 OSCOM
Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.
Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.
- Login or register to post comments
- Printer-friendly version
- daniel's blog
- 558 reads





