Skip to main content

Leftovers

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
game.

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
refrigerator.

Really, the thoughts on leftovers began with the lead from today's href="http://weblogs.java.net/"> Weblogs, in which Allen
Chan blogs about href="http://weblogs.java.net/blog/allenc/archive/2004/11/aop_and_code_ma_1.html">
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="http://weblogs.java.net/blog/jfalkner/archive/2004/11/blarg_10_im_con.html">
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="http://www-106.ibm.com/developerworks/library/wi-secure/">
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="http://www.onjava.com/pub/a/onjava/2004/11/17/dunamis.html">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 java.net
project, Dunamis, which
provides a bytecode-manipulation implementation for dynamic
delegation.


In Projects and
Communities
,in an item of interest to href="http://community.java.net/games/">Java Games Community
members, Fortune Magazine columnist David Kirkpatrick discusses href="http://www.fortune.com/fortune/fastforward/0,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
phones.

Members of the href="http://community.java.net/netbeans/">NetBeans Community
might appreciate this how-to tip on href="http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/filesystems/doc-files/HOWTO-MIME.html">
Declarative MIME Type Resolvers which, as href="http://blogs.sun.com/roller/page/toddfast/20041105#declarative_mime_resolvers_in_netbeans">
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="http://forums.java.net/jive/index.jspa"> Forums, xhq
requests the addition of href="http://forums.java.net/jive/thread.jspa?messageID=6629&tstart=0#6629">
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="http://forums.java.net/jive/thread.jspa?messageID=6565&tstart=0#6565">
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 java.net
News Headlines
:

Registered users can submit news items for the href="http://today.java.net/today/news/">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
the href="http://today.java.net/pub/q/news_rss?x-ver=1.0">java.net
News RSS feed.


Current and upcoming
Java Events
:

  • November 27 href="https://hkjug.dev.java.net/servlets/NewsItemView?newsItemID=1428">Hong
    Kong JUG - J2SE 5.0 Update
  • December 6-9, 2004 href="http://www.theserverside.com/architecture_workshop/index.html">
    TheServerSide Enterprise Java Architecture Workshop
  • December 7-8, 2004 href="http://jini.org/meetings/eighth">Eighth Jini Community
    Meeting
  • December 13-17, 2004 href="http://wiki.javapolis.com/">JavaPolis, 2004

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e"> 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 href="http://today.java.net/today/archive/">java.net Archive.

Estimating with an eye on reuse