Skip to main content

Caffeine and Code

Posted by daniel on July 22, 2004 at 8:33 AM PDT

MacHack has evolved into Adhoc but most of the traditions remain.

The Adhoc conference began last night at midnight and for the next 72 hours a collection of developers with write code, compare hacks, and exchange ideas in sessions. David Pogue's opening keynote ended around 3:15 in the morning. He was prepared to go longer and clearly had hours of material left that he could have delivered but he noticed many members of the audience were starting to nod a bit. That wasn't a reflection on him - it was three in the morning.

In any case, please forgive typos and sentences that don't end. For the next couple of days, late night keynotes and code coupled with breakfasts of pop-tarts, twinkies, and Diet Coke. Life is pretty perfect right now.

In Also in Java Today ,
in Put JSF to work Derek Yang Shen "shows you how to integrate JSF with other Java frameworks—specifically, the Spring Framework and Hibernate. It demonstrates how to create the JCatalog Web application, an online product catalog system. Using the JCatalog example, this article covers each phase of Web application design, including business-requirement gathering, analysis, technology selection, high-level architecture, and implementation-level design. The article discusses the advantages and disadvantages of the technologies used in JCatalog and demonstrates approaches for designing some of the application's key aspects."

O.K. - this article isn't exactly AOP but Lara D'Abreo tags Java Dynamic Proxies: One Step from Aspect-oriented Programming. Where others are using aspects to code up debugging or logging, D'Abreo suggests starting by centralizing the logic and using proxies instead. She says that understanding these proxies is a step on the way to working with Aspects.

Chris DiBona blogs about Some
final words about distribution divergence...and a request for Java Gotchas..

in today's
Weblogs He asks: What's the
hardest thing about developing Java applications? He wanted some thoughts on
what to worry about when porting an application from C++ "which is heavily
templated, poorly commented, but thoroughly unit tested" and I thought, where
better to ask then here. What gotchas would you pass on about java development?

Meeraj Kunnumpurath writes about href=""> Rich Domain Model and Transparent
Persistence. He's just worked on a project with Rod Johnson and is thinking
differently about "the over-emphasis on use case analysis without significant
attention to proper domain modelling. The system was seen as a black box
monolith that accepted user requests and produced responses. This led to the
design of a bunch of stateless services exchanging dump data between the invoker
and the invoked. As a result, domain logic was often duplicated in the various
application layers."

Maybe you shouldn't always override toString.
In today's Forums,
grlea disagrees with Item 9 saying that " I am currently reviewing our company's coding standards and floated this as a proposed rule. One developer came back and said "How many of your classes do you actually call toString() on?" His point is a good one: a lot of objects don't contain anything worth reporting from toString() - it just doesn't make sense."

Tackline agrees with Item 8 says "Surely almost anyone who's ever written a class to be used as a key for a map has come across this one. HashMap or Hashtable are by far the two commonest used implementations. If you don't override hashCode it should become very clear, very quickly (you do run your code, right?). Possibly the mistake could be made if it is never intended to be used as a key."

Trition says that "singletons are overrated. They tend to make sense in the short-term but can cause problems in the long term. When I consider a singleton, I ask myself the questions, "am I really wise enough to know that you will never need distinct instances?" and "will it hurt if there is more than one instance?" Often times, singletons are sought just for their convenience."

In Projects and Communities, the Expert Group for JSR 211, Content Handler API, has published an Early Draft Review. Their goal is to enable J2ME applications to handle multi-media and web content on mobile phones and wireless devices.

The JavaPedia entry
on implementing Singleton includes a template with protected constructor and static variable and accessor. Join the discussion or add to the resources.

In today's News Headlines

Registered users can submit news items for the href=""> News Page using
our news submission
. All submissions go through an editorial review before being posted to the site. You can also subscribe to
News RSS feed

Current and upcoming
Java Events

Registered users can submit event listings for the href=""> Events Page using our href=""> 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
Today RSS feed
. Also, once this page
is no longer featured as the front page of
it will be archived along with other past issues in the href=""> Archive.