Utility Based Development Approach, Applying Forward Thinking to Your Programming
by Samudra Gupta
Programming is a challenge to most of us. It is a logical
thinking process translated into a piece of code written in a
particular programming language. Programming languages have
evolved from machine language to today's high level languages
such as Java, C++ etc. With the evolution of these languages, our
outlook towards solving a problem has also evolved. We have gone
through the transition from procedural thinking to Object-
Oriented and most recently to the Aspect Orientation. In this
article, we will consider another hidden aspect of
programming,which I intend to name as "Utility Based
Development".
Utility Based Development
Don't fret, it's not another completely new process. I find
it's most useful to take this approach when I am actually ready to
cut the code. Utility Based Development is an approach in which
we are able to extend a specific use-case requirement to
accommodate a broader requirement and also we are able to
extract reusable utility components out of every module that can
be reused by other modules. When we are working in a large-scale
project, often programmers will start from a high-level design
document. This design document gives us a high-level view of how
different parts of the system interact with each other. It also
tells us about the internal structure of each component
within the system. It is often use-case centric and primarily
focused towards accomplishing all the use-cases by specifying
service components, their interaction mechanism and persistence
of data.
However, ground reality of developing each component is often
different. The design document does not tell us about each step
involved in developing a component. While we want to achieve the
specified component structure and the interaction to accomplish
certain business process, we also want to do it in an efficient
manner. The efficiency of a piece of code also relies upon how
optimized the code is. Optimization of a component on the other
hand depends on the optimization of individual classes that
constitute the component.
For an example, imagine you are writing a hotel reservation
application. This application will make use of components such
as Reservation component, Invoice component, etc. All of these
components will need to deal with dates in different formats
such as British and American date formats. It would be better if
we factor out the routines to format dates in another utility
class and let individual components make use of the date utility
class. This way the code is more optimized.
The above scenario highlights a case of Utility Based
Development. It sounds simple and all of us at one time or
another thought about it, but in this article, I will share some
methods of making this approach more formal and help to apply a
certain methodology to it.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.