Java Reference
In-Depth Information
By contrast, figure 2.4 shows the Page Detailer output for http: //
www.amazon.com. There were 10 times the number of items, and the load
time was roughly 10 times as long. Though this test does not prove that the
longer load times are due to the higher number of graphics, the circumstantial
evidence is interesting. Since each of these objects will trigger a separate HTTP
GET , there is a distinct performance penalty, and though small graphics are
blocked by many browsers in groups of four and should load quickly, the
effects are cumulative. For a Java programmer, the lesson is clear: a Java Inter-
net application can be only as good as its supporting architectures and page
designs. Reducing the number of web objects can reduce the load time, espe-
cially when transactions are very short or resources are constrained.
We have seen the basic building blocks that will support Java server-side
programming. As we move up the food chain, we begin to discuss the applica-
tions that incorporate these layers. We will now briefly examine the organiza-
tional principles of Java through object orientation. We will consider the
traditional view that the supporting layers can help us, and we will also look at
some ways those layers can work against us.
2.3
Object technologies and antipatterns
Although object-oriented programming ( OOP ) requires a different methodol-
ogy and thought process than its procedural predecessor, the fundamental
concepts are few and simple. In structured programming, one divides data
into data structures and programs into functions. If a procedure or function is
too complex, it is decomposed into several simpler procedures. Complex
problems are decomposed into smaller and smaller units until each is of a
manageable size. Figure 2.5 shows the typical organization of a structured
Functions
Data
Figure 2.5 Structured programming calls for the separate creation and maintenance of major
data structures and programs. Taking larger procedures and decomposing them into smaller
ones control complexity but can make maintenance problematic. The famous Y2K bug thrived
under conditions of structured programming.
Search WWH ::




Custom Search