[thelist] Content Management System on IIS 5

Steve Lewis slewis at macrovista.net
Fri Jun 28 03:50:01 CDT 2002


Judah McAuley wrote:

 >It didn't say "make money fast!  Dynamic content
 >will get you hot women!" etc.

But Dynamic content will make money fast and get me hot women!  That's
what you told me, Judah!

--Steve

<tip author="Steve Lewis" subject="Software Development - Reuse">
There are two fundamental concepts that can help you reuse code.
Understanding these is crucual to designing code that you will be able
to reuse with minimal redesign and maximum benefit: encapsulation and
information hiding.

Encapsulation (also known as data abstraction) is a language facility
you must identify and become proficient with.  Encapsulation refers to
the bundling of data with the methods that operate on that data.  In
Java and other Object Oriented languages we do this by defining the data
structures and the methods to operate on those data scrutures and
*encapsulating* them into a class definition.  Whenever you need to work
with or retrieve data from an object of that class, there will be a
method to do it.

In web scripting languages encapsulation can be emulated.  This requires
progressively using 'include' statements to call more task-specific code
(see also the 'fusebox method' as used with ColdFusion) as your task
becomes more well-defined, and by carefull isolation of tasks.

Information hiding is a design principle.  David Parnas first introduced
the concept of information hiding around 1972 stressing the 'hiding of
critical design decisions'.  Information hiding does not in fact refer
to hiding data, but can be understood more clearly if you consider it
equivalent to careful and effective delegation of tasks.  The recurring
billing module doesn't worry about how accounts are settled.  It knows
which module to delegate that work to, and understands how to talk to it.

If you practice using encapsulation and information hiding, you are in
good shape to implement code reuse.

Here are some of the other things you need to consider:

-Documentation:  reuse requires good documentation or time will be
wasted in identification and reinterpretation.

-Choose wisely: Only invest in components that you really will reuse.
Developing a reusable component will cost approximately three times as
much as developing the same product for stand-alone use (Fred Brooks 1995).

-Quality first: If a developer tries to reuse a component finds a bug,
considerable time has been wasted.  Further, small code libraries are
used at least as heavily as large ones (Pfleeger 1994, Frankes and Fox 995).
</tip>




More information about the thelist mailing list