Java Reference
In-Depth Information
With four kayaks on top of the jeep, two local guides, a close friend, and I are driv-
ing up the Piedra River in Colorado. The river is pristine and intensely beauti-
ful. Its steep gradient and the huge water volume remind us of the formidable
reputation it has among kayakers, but I feel confident. We have asked our guides
to take us to the easy section. We drop off our car and put in.
I follow our local guide closely. The plan is to blow through the first few less
technical rapids without scouting and then head downstream. I paddle around a
river bend and, as I take in the sight and sound, my stomach tightens. The river
explodes around me. I am not moving nearly fast enough—and I haven't scouted.
As I plunge over the waterfall, I realize I have no chance. I flip quickly, miss my
roll, and I am now struggling to pull out of my kayak in the middle of a Class
IV+ rapid.
2.1
F ertile grounds for antipatterns
Over the last decade, open Internet standards supported by components and
frameworks have relieved us of the burden of writing complex communication
layers. After a couple of decades of struggling with memory management and
multiple inheritance in C and C ++ , programming environments like Java have
allowed us to concentrate on the application more than the programming lan-
guage. Traditional struggles with distributed communication, database pro-
gramming, and inadequate object packaging are now handled by EJB s and
even Common Object Request Broker Architecture ( CORBA ), which hides
much of the complexity of these problems.
This rich and fertile soil has made it easier for us to grow increasingly
sophisticated applications. But rich soil is fertile for weeds, too. With the
increased power of frameworks comes the danger of increased laziness. New
layers can also add complexity and heavier processing burdens.
Antipatterns love to hide, and we generally give them plenty of opportu-
nity to do so. In this chapter, we will review the basic building blocks of
server-side Java. We will explore its landscape and, along the way, expose many
of the crevices that conceal antipatterns. We will also lay a common founda-
tion so we can begin the discussion of Java antipatterns with a shared perspec-
tive and terminology.
2.1.1
The benefits of layering
Modern programming systems organize increasingly complex ideas by build-
ing increasingly complex and abstract services using layers. Early computers
did not layer services at all. Programs were necessarily small because hardware
Search WWH ::




Custom Search