Skip to main content


Posted by daniel on November 24, 2004 at 8:05 AM PST

Estimating with an eye on reuse

In the US, tomorrow is one of my favorite holidays:
Thanksgiving. It is traditionally a celebration of the harvest and a
time to gather with family and friends. The spirit of this holiday in
many homes has migrated from a time to give thanks to a time to eat
too much turkey and side dishes during half-time of a football

Many homes buy turkeys that are much too large for the assembled
family to eat so that they can use the leftovers for soup, hash,
sandwiches, and other creations. So many of us have come to see our
favorite leftover concoction as part of the tradition that we would be
disappointed if the entire turkey was eaten during Thanksgiving dinner
itself. In other words, we estimate our dinner with leftovers in mind.

With coding - how do we think of reuse? Are we at a point where we
start planning for our code leftovers? XP teaches us not to code for
situations we don't yet need, but a customer could have a reusability
story. The other thing about leftovers, is that eventually you either
use them up or they go bad and you have to throw them out. In food,
you can see the cost of throwing out unsold food.

Except for the well worn "stone soup" metaphor, we don't tend to
use food analogies for software. In the restaurant business you double
sell your food. If you have left over bacon from breakfast you use
them in club sandwiches at lunch. I saw one kitchen rinse off left
over chicken breasts prepared as chicken Marsala, chop them up, and
use them in a chicken stirfry. There the plan wasn't for reuse - but
rather, before starting to cook, looking around to see what was in the

Really, the thoughts on leftovers began with the lead from today's href=""> Weblogs, in which Allen
Chan blogs about href="">
AOP and code maintainability . He argues that "an effective way to
manage aspects will need to be derived before AOP can become a
mainstream programming paradigm."

Jayson Falkner answers another reader question in href="">
I'm confused about keeping proper web application state. He
explains "You need to keep in mind what is shared and what is not
shared when thinking about state. For each doGet() method invocation a
new HttpServletRequest object is made, and you can access this object
without fearing that any other thread is concurrently accessing
it. However, this changes for the HttpSession object. Two requests
from the same user might try to change the same session object. There
is only one session object per a user accessing the web app."

In Also
in Java Today
, there is a developerWorks article on href="">
Using JCE in a J2ME environment. You may want to consider the
caution at the end before reading the article: "Though this solution
for using JCE in J2ME development works in the sample environment,
you should consider it carefully before using it. First, using JCE to
provide cipher functions is one way to offer security solutions,
which can save you time writing customized cipher libraries. But note
that JCE is a relatively large library and has a big footprint
relative to the J2ME environment. For mission-critical applications,
light-weight customized cipher libraries are more suitable."

Lu Jian wants to take Java's Proxy class a step further. Introduced
in Java 1.3, Proxy lets you use an InvocationHandler to provide method
implementations at runtime, but it only works with interfaces. In href="">Dynamic
Delegation and Its Applications, he takes this a step further by
providing a Delegation class, which allows you to delegate abstract
classes and even concrete classes. He's also started a
project, Dunamis, which
provides a bytecode-manipulation implementation for dynamic

In Projects and
,in an item of interest to href="">Java Games Community
members, Fortune Magazine columnist David Kirkpatrick discusses href=",15704,784133,00.html?cnn=yes">
the rapid growth of cellphone gaming in the form of Jamdat
Mobile, a publicly-traded maker of J2ME (and BREW) games for mobile

Members of the href="">NetBeans Community
might appreciate this how-to tip on href="">
Declarative MIME Type Resolvers which, as href="">
Todd Fast's Weblog describes it, allows NetBeans "to recognize an
XML file without opening every candidate file in your DataLoader and
parsing it".

It's important to look good. In today's href=""> Forums, xhq
requests the addition of href="">
good third-party layout mangers saying "It seems many people don't
like the current standard layout managers(especially GridBagLayout),
and tend to use third-party open source alternatives, like
TableLayout, FormLayout and ExplicitLayout. [..] Any chance for one
of these excellent layouts to go into Mustanq?"

Iwadasn has a list of suggestions for href="">
under the hood. The items are prefaced "The language should be a
simple as possible, certainly no more complicated than it is
already. API changes are somewhat better, want an API for everythign
under the sun, fine. Now lets talk about under the hood. Here are a
few things I'd like to see."

In today's
News Headlines

Registered users can submit news items for the href=""> 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
the href="">
News RSS feed.

Current and upcoming
Java Events

  • November 27 href="">Hong
    Kong JUG - J2SE 5.0 Update
  • December 6-9, 2004 href="">
    TheServerSide Enterprise Java Architecture Workshop
  • December 7-8, 2004 href="">Eighth Jini Community
  • December 13-17, 2004 href="">JavaPolis, 2004

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.

Estimating with an eye on reuse