File: design.html

package info (click to toggle)
libproxool-java 0.9.0~rc3-2
  • links: PTS, VCS
  • area: contrib
  • in suites: lenny
  • size: 2,416 kB
  • ctags: 2,446
  • sloc: java: 13,891; xml: 802; makefile: 12; sh: 10
file content (242 lines) | stat: -rw-r--r-- 8,383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242






<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">





<html>
  <head>
    <meta http-equiv="Content-Language" content="en-gb">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="Expires" content="-1">
    <meta http-equiv="Pragma" content="no-cache">
    <title>Proxool 0.9.0RC3</title>
    <link href="proxool.css" type="text/css" rel="stylesheet">
  </head>

  <body>

 <div style="max-width: 1200px;">
    <table border="0" style="min-height: 100%;" cellpadding="0" cellspacing="0" width="100%">
      <tbody>

        <tr>
          <td valign="bottom" width="150">
            &nbsp;
          </td>

          <td colspan="2" height="50">
            
              <div class="bannerFinal">
            
            
            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                  <td height="50">
                    <span class="titleCaption" style="font-size: 110%; padding: 4px;">
                        Why we did what we did
                    </span>
                    
                  </td>
                  <td valign="middle" height="50">
                    <div>
                      

<div style="float: right; margin-right: 8px;">
    <img src="images/dots.gif" width="80" height="20" border="0" alt="...">

    <a href="http://sourceforge.net/projects/proxool"><img src="images/sflogo.png" width="88" height="31" border="0" alt="SourceForge.net Logo"></a>

</div>

                    </div>
                  </td>
                </tr>
            </table>
            </div>
          <td width="10">&nbsp;</td>
        </tr>

        <tr>
          <td valign="top" width="150">
            &nbsp;<br/>
            &nbsp;<br/>
            <table
              cellpadding="0"
              cellspacing="0"
              border="0"
              width="100%"
            >
              <tbody>

                <tr>
                  <td valign="top">
                    
                    
                    
                    
                    



<div class="menuBox" >
    <div class="menu-inactive"><a class="menu-inactive" href="index.html">Home</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="news.html">News</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="faq.html">FAQ</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="tips.html">Tips</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="changelog.html">Changes</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="future.html">The Future</a></div>
    
    <div class="menu-inactive"><a class="menu-inactive" href="user.html">User&nbsp;Guide</a></div>
    
        <div class="menu-active"><a class="menu-active" href="dev.html">Developer&nbsp;Guide</a></div>
    
    <div class="menu-inactive"><a class="menu-inactive" href="licence.html">Licence</a></div>
    <div class="menu-inactive"><a class="menu-inactive" href="credits.html">Credits</a></div>

    <div class="menu-separater">Developer&nbsp;Guide:</div>
    <div style="margin-left: 8px">
        <div class="menu-inactive"><a class="menu-inactive" href="dev.html">Introduction</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="build.html">Build</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="api-dev/index.html">Full API</a></div>
        <div class="menu-active"><a class="menu-active" href="design.html">Design</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="test.html">Testing</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="report.html">Test Report</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="devList.html">Mailing List</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="contribute.html">Contribute</a></div>
        <div class="menu-inactive"><a class="menu-inactive" href="dependencies.html">Dependencies</a></div>
    </div>
</div>
                  </td>
                  <td>&nbsp;</td>
                </tr>

                <tr>
                  <td>
                    

                    <table cellpadding="0" cellspacing="0" border="0" summary="">
                      <tbody>

                    <tr><td>







    <div class="rightItem">
        <div class="rightItemHeader">Version 0.9.0RC3</div>
        <div class="rightItemContent">
            The latest version of this documentation and software is available on our web site:
            <br/><a href="http://proxool.sf.net">proxool.sf.net</a>
        </div>
    </div>

<div class="rightItem">
    <div class="rightItemHeader">Donations</div>
    <div class="rightItemContent">
        You can donate to Proxool in the usual way:
        <br/><a href="http://sourceforge.net/project/project_donations.php?group_id=53958">sourceforge.net</a>
    </div>
</div>
</td></tr>

                <tr>
                    <td>
                        
<div class="footer">
                last&nbsp;updated: 10-Jan-2007
</div>



                    </td>
                </tr>
        </tbody>
      </table>

                  </td>
                  <td>&nbsp;</td>
                </tr>

              </tbody>
            </table>
          </td>

          <td valign="top" colspan="2">
            <table cellpadding="0" cellspacing="0" border="0" width="100%" summary="">
              <tbody>
                <tr>
                  <td class="contents" valign="top">
                    <p>This isn't so much a design as a list of why we made the decisions we did. If you
disagree with anything then feel free to let us know...</p>

<hr>

<h4>Logging</h4>

<p>Goals: 1) not replicate the work that has gone into other logging projects, 2)
make it fast, 3) make it pluggable so you're not tied to a particular solution.</p>

<p>Solution: use Jakarta Common's ultra thin
<a href="http://jakarta.apache.org/commons/logging.html">logger</a>. This will
automatically log to Log4J or JDK&nbsp;1.4's logger. If you want it to log
somwehere else then you just need to write a simple wrapper.</p>

<p>Good: it's already written, it's robust, it works.</p>

<p>Bad: nothing really :)</p>

<hr>

<h4>Proxy</h4>

<p>To get transparent control when people close a connection we need to proxy the Connection
object itself. This is easy enough to do: create an object called ProxyConnection which
contains a real Connection and delegate everthing (except the close method) to the
Connection. The trouble with this solution is that the API to the Connection object changes
with each release of the JDK. This means you have to constantly update the proxy and deploy
different versions for different JDKs. Not nice.</p>

<p>JDK 1.3 introduces the Proxy class that does a lot of this delegation for you using
reflection. This makes it really easy and means that when the API changes everything still
works. Unfortunately, it won't work with JDK&nbsp;1.2. So we have patched up some hand written
proxies that work with JDK 1.2 only. They are contained within a different source tree to the
main code. When you use Ant to build your jar (and you specify that you are targetting
JDK&nbsp;1.2) then it copies over these patched classes before compilation. This is not
an ideal solution, but at least it should go away over time when we eventually drop support
for JDK&nbsp;1.2 (which we're not in a rush to do, by the way).</p>

<p>Using reflection is slower. No doubt about it. Quick tests have shown that it might add
1 or 2 milliseconds to each database call. I suggest that this isn't really significant
and that the ease of use and maintainability outweigh this slight delay.</p>


                  </td>
                </tr>
              </tbody>
            </table>
          </td>
        </tr>

      </tbody>
    </table>
  </div>
  </body>

  <head>
    <meta http-equiv="Expires" content="-1">
    <meta http-equiv="Pragma" content="no-cache">
  </head>

</html>