| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> |
| 2 |
<HTML> |
| 3 |
|
| 4 |
<HEAD> |
| 5 |
|
| 6 |
<LINK rel=stylesheet type="text/css" |
| 7 |
href="../acedocs.css" |
| 8 |
title="Style sheet for general ace documents"> |
| 9 |
|
| 10 |
<title>ACEDB - in the Short Term</title> |
| 11 |
<meta name="keywords" content="acedb, future, plan, strategy, changes"> |
| 12 |
<meta name="description" content="Thoughts/ideas about how Acedb will develop in the future."> |
| 13 |
|
| 14 |
</HEAD> |
| 15 |
|
| 16 |
|
| 17 |
<BODY> |
| 18 |
|
| 19 |
<h1>ACEDB - in the Short Term</h1> |
| 20 |
|
| 21 |
<A name="intro"> |
| 22 |
<FONT color="blue"> |
| 23 |
<h2>Introduction</h2> |
| 24 |
</FONT> |
| 25 |
</A> |
| 26 |
|
| 27 |
<p>Some of these changes are really just bugs, others are smaller changes |
| 28 |
that could be made for relatively little effort.</p> |
| 29 |
|
| 30 |
<h2>For users</h2> |
| 31 |
|
| 32 |
<A name="windows"> |
| 33 |
<FONT color="blue"> |
| 34 |
<H3>acedb on MS windows</H3> |
| 35 |
</FONT> |
| 36 |
</A> |
| 37 |
|
| 38 |
<p>Thanks to <A href="mailto:[email protected]">Richard Bruskiewich</A> we have had a windows |
| 39 |
version of acedb for a while. One problem with this version was that it required different code |
| 40 |
for the windowing routines on Unix and Windows. Thanks to |
| 41 |
<A href="mailto:[email protected]">Simon Kelley</A> we now have a version of acedb based on the |
| 42 |
GTK widget set which can be used on Windows and Unix. More importantly Simon has also installed a |
| 43 |
working environment under Windows that provides the unix utilities for building acedb. This means |
| 44 |
that it will be much easier to produce windows and unix versions in unison. This version of acedb |
| 45 |
will be available in acedb 4_8.</p> |
| 46 |
|
| 47 |
<A name="widget"> |
| 48 |
<FONT color="blue"> |
| 49 |
<H3>New Widget Set</H3> |
| 50 |
</FONT> |
| 51 |
</A> |
| 52 |
|
| 53 |
<p>The new GTK widget set is being introduced with ACeDB 4_8 which will greatly improve the |
| 54 |
look/feel of acedb applications. This widget set has been chosen because it is free and is |
| 55 |
supported on both Unix and Windows. This means that for the first time we can have one version |
| 56 |
of the source code that will run on both Windows and Unix. The interface will bring the |
| 57 |
following advantages:</p> |
| 58 |
<OL> |
| 59 |
|
| 60 |
<LI>the interface will look like other common interfaces (Motif, Windows). |
| 61 |
<LI>Common interface actions such as: |
| 62 |
<OL> |
| 63 |
<LI>fully edittable text fields |
| 64 |
<LI>keyboard short cuts (page up/down keys, ESC to cancel an action, etc.) |
| 65 |
<LI>copy & paste or drag & drop (for acedb and other application windows) |
| 66 |
</OL> |
| 67 |
will be implemented using the new widget set instead of having to write code |
| 68 |
within acedb to do this. |
| 69 |
<LI>displays will be clearly separated into 'control' sections (buttons/sliders etc.) and |
| 70 |
'data' sections. The data sections will be completely acedb controlled as before |
| 71 |
using the graph package. The control sections will use the GTK widget set. |
| 72 |
Printing will be of the data sections only. |
| 73 |
</OL> |
| 74 |
<p>The major disadvantage of the GTK widget set is that it is not supported on the Mac.</p> |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
<A name="help"> |
| 79 |
<FONT color="blue"> |
| 80 |
<H3>Help files</H3> |
| 81 |
</FONT> |
| 82 |
</A> |
| 83 |
<p>Just about all the help files are in html now and are displayed either via a browser (usually |
| 84 |
netscape) or via a cut down internal html parser which may not display all help files perfectly. |
| 85 |
The help files must still be in a predefined directory |
| 86 |
within the the target database directory tree (whelp).</p> |
| 87 |
|
| 88 |
<P>There have been several suggestions to do with improving the help facilities: |
| 89 |
<UL> |
| 90 |
<LI>Users should be able to specify whether the acedb html parser is used to display |
| 91 |
help files or whether an external browser should be used. |
| 92 |
<LI>We should allow help files to be local to the directory database or via http url. |
| 93 |
<LI>Help needs to be divided into two sections: the first would be common to all databases |
| 94 |
(e.g. a description of how the keyset window can be used), the second would be |
| 95 |
specific to a database (e.g. describing the actual columns in an fmap display). |
| 96 |
No decision has been made about how this should be done yet. |
| 97 |
</UL> |
| 98 |
</p> |
| 99 |
|
| 100 |
<h2>For developers</h2> |
| 101 |
|
| 102 |
<A name="nfs"> |
| 103 |
<FONT color="blue"> |
| 104 |
<H3>NFS and acedb databases</H3> |
| 105 |
</FONT> |
| 106 |
</A> |
| 107 |
<p>There is an ongoing problem with having acedb databases accessed for writing on NFS mounted |
| 108 |
disks. The problem is that acedb writes of the database are done using buffered writing, this |
| 109 |
means that if for any reason the NFS write fails then the acedb application does not see it. |
| 110 |
We could set the database files to be written to synchronously but this will probably clobber |
| 111 |
performance. This seems to be the reason for database corruption on several occasions recently. |
| 112 |
Trials are going on to look at doing synchronous writes.</p> |
| 113 |
|
| 114 |
|
| 115 |
<A name="sockets"> |
| 116 |
<FONT color="blue"> |
| 117 |
<H3>Sockets</H3> |
| 118 |
</FONT> |
| 119 |
</A> |
| 120 |
<p>The current mechanism for communicating between an acedb server and client is based on rpc, |
| 121 |
this method is being changed to sockets for the following reasons: |
| 122 |
<DL> |
| 123 |
<DT>Portability |
| 124 |
<DD>rpc has been difficult to maintain on all unix systems and is known to be buggy |
| 125 |
on windows systems. sockets, being a fundamental method of communication are |
| 126 |
solidly implemented on all these systems. |
| 127 |
<DT>Connectivity |
| 128 |
<DD>Sockets are such a standard way of communicating that access to them is provided |
| 129 |
in many environments (e.g. perl). Providing a socket interface to the server |
| 130 |
makes it more easily available to other programs/interfaces (e.g. aceperl). |
| 131 |
<DT>Efficiency |
| 132 |
<DD>with rpc we are stuck with just one level of efficiency, using our own transport layer |
| 133 |
based on sockets will allow us to use different communication methods according to where |
| 134 |
the client and server are running: |
| 135 |
<DL> |
| 136 |
<DT>tcp sockets |
| 137 |
<DD>used where client and server are on different machines, least efficient. |
| 138 |
<DT>unix domain protocol |
| 139 |
<DD>used where client and server are on same machine but shared memory does |
| 140 |
not exist, probably at least twice as fast as tcp sockets. |
| 141 |
<DT>shared memory |
| 142 |
<DD>used where client and server are on same machine, maybe an order of magnitude |
| 143 |
faster than tcp sockets |
| 144 |
</DL> |
| 145 |
Currently there is code for tcp sockets but with minimal tweaking this will support |
| 146 |
unix domain protocol communication. Shared memory will require more work. |
| 147 |
<DT>Reliability |
| 148 |
<DD>rpc provides a simplified interface to network communcation, this is fine as long |
| 149 |
as everything is working, when errors occur it is very difficult to identify the |
| 150 |
precise cause. Sockets provide more information about the errors. |
| 151 |
</DL> |
| 152 |
There is prototype code working with serveral clients communicating with an ace server. The aim |
| 153 |
is to provide socket based client/servers for acedb 4_8, this will then become the way for |
| 154 |
clients/servers to communicate, support for rpc will be withdrawn.</p> |
| 155 |
|
| 156 |
<P><B>There is still a disussion going on about whether the new version of the client should |
| 157 |
connect to both rpc and socket based servers.</B> There are pros and cons, on the one hand |
| 158 |
it's easier for users if it connects to both, on the other it may not be possible for us |
| 159 |
to reliably detect what protocol the server is using (MS Windows anyone...?) and also it could |
| 160 |
be a good mechanism for us getting users to update there servers/clients if the new client only |
| 161 |
works with the new server. <B>This needs a bit of thought.</B></p> |
| 162 |
|
| 163 |
<A name="bugs"> |
| 164 |
<FONT color="blue"> |
| 165 |
<H3>Bugs...</H3> |
| 166 |
</FONT> |
| 167 |
</A> |
| 168 |
|
| 169 |
<p>There are (not surprisingly) a number of bugs that have crept into |
| 170 |
acedb over the years, here are some of them. |
| 171 |
<DL> |
| 172 |
<DT>Hard coded strings/numbers |
| 173 |
<DD>There are many instances where numbers or strings are hard coded rather than via |
| 174 |
a common symbol, this applies to buffer sizes, directory names etc. etc. |
| 175 |
The number is being reduced and where possible enums are being used because they |
| 176 |
can be seen by the debugger. |
| 177 |
<DT>Redeclaring Values |
| 178 |
<DD>Much progress has been made in restructuring header files into sets of private/public |
| 179 |
headers for each package within acedb. There is still some work to be done by the |
| 180 |
reorganisation of the code into libraries has greatly cleaned up the structure of the code. |
| 181 |
<DT>Redeclaring functions |
| 182 |
<DD>There are a number of files which contain redeclarations of functions |
| 183 |
already in declared in a header files, sadly this is still true, the number is reducing |
| 184 |
but there are still some instances. |
| 185 |
e.g. in ./w9/gfcode.c |
| 186 |
<PRE> |
| 187 |
extern void fMapAddGfSite (int type, int pos, float score, BOOL comp) ; |
| 188 |
</PRE> |
| 189 |
<FONT color="red">This is terrible...</FONT> it opens up the possibility |
| 190 |
of functions being declared |
| 191 |
slightly wrongly which can introduce subtle bugs that are very difficult |
| 192 |
to find. Functions with external scope should be declared in just one header |
| 193 |
file only. |
| 194 |
<DT>'char' vs. 'unsigned char' |
| 195 |
<DD>anything declared as 'char' is at the whim of the compiler as |
| 196 |
to whether it is signed or unsigned (see the ANSI C standard), this can |
| 197 |
be serious if the data is for instance image data and should be treated |
| 198 |
as having values in the range 0 - 255. |
| 199 |
<P> |
| 200 |
A possible example can be seen in file graphxlib.c in the declaration of |
| 201 |
function rawImage: |
| 202 |
<PRE> |
| 203 |
static XImage *rawImage (char *data, int w, int h, int len) |
| 204 |
</PRE> |
| 205 |
<DT>not checking return code of common system calls |
| 206 |
<DD>call such as printf, fprintf, sprintf etc. all return a return code which is rarely |
| 207 |
checked, this is certainly true of acedb code. We should decide if this is to |
| 208 |
be continued and documented as a hole in the code or rectified. |
| 209 |
<DT>use of sprintf/vsprintf |
| 210 |
<DD>there are a number of places in acecb code where sprintf or vsprintf are used to |
| 211 |
write data into a buffer. Unfortunately there is no way of knowing in advance how |
| 212 |
much data will be written nor can the amount of data written be controlled. This |
| 213 |
produces the real danger that the buffer will overflow. The messprintf code has |
| 214 |
been altered to handle this as well as possible, there is also a new call in some |
| 215 |
libc versions called snprintf which will only print out up to the requested number |
| 216 |
of bytes. When this call becomes more widely available it will be included in the code. |
| 217 |
(perhaps we should #ifdef this in for operating systems that support this new call ??) |
| 218 |
</DL> |
| 219 |
|
| 220 |
<A name="makefiles"> |
| 221 |
<FONT color="blue"> |
| 222 |
<H3>Makefiles</H3> |
| 223 |
</FONT> |
| 224 |
</A> |
| 225 |
|
| 226 |
<p>The following discussion talks about the directory structure for each individual |
| 227 |
developer, this is NOT a shared directory structure.</p> |
| 228 |
|
| 229 |
<P>Currently the makefiles allow a user to log onto different machines (Sun, HP etc), |
| 230 |
type 'make' and have the make run and put its results into a machine specific |
| 231 |
directory. There are still some improvements to be made:</p> |
| 232 |
|
| 233 |
|
| 234 |
<OL> |
| 235 |
<LI>The directory hierachy has been substantially reorganised/renamed so that directory names |
| 236 |
reflect the purpose of the code within them but there is still some work to do. |
| 237 |
<LI>The private header files for a package should be kept in the same directory as the |
| 238 |
code files for the package, the public header files for the package can go in the |
| 239 |
common wh directory. This work is mostly done but many source files do not correctly specify |
| 240 |
the acedb header files as either <B><wh/header.h></B> for public headers or as |
| 241 |
<B><wpackage/header.h></B> for private headers. |
| 242 |
<LI>We should consider altering the make files to allow |
| 243 |
compilation from within that directory, |
| 244 |
at the very least it should be possible to say something like 'make fmapcontrol.o' |
| 245 |
and just compile a single object file. The makefile at the bottom of the tree will |
| 246 |
allow a developer to type 'make' and have the entire the development tree remake |
| 247 |
itself. This bottom level makefile will also ensure that the code is built in the |
| 248 |
correct order (libraries first, applications next). |
| 249 |
<LI>Dependencies still need a lot of work so that code is correctly recompiled (we can also |
| 250 |
use the makedepend tool to help with this). |
| 251 |
<LI>extra targets such as 'clean' and 'install' need tidying up, |
| 252 |
</OL> |
| 253 |
|
| 254 |
<A name="dbase_paths"> |
| 255 |
<FONT color="blue"> |
| 256 |
<H3>acedb directories</H3> |
| 257 |
</FONT> |
| 258 |
</A> |
| 259 |
|
| 260 |
<p>acedb applications expect databases that they are run against to have a standard |
| 261 |
directory tree format, e.g. given a database directory of "cgc" then "cgc/database" |
| 262 |
will contain the actual database files, "cgc/wspec" will contain the files |
| 263 |
describing the format of the database files etc. etc. Unfortunately this database |
| 264 |
tree structure is scattered across the code as individual strings embedded in |
| 265 |
routines (e.g. "wspec"). This seems like encapsulation but in fact means that |
| 266 |
to alter or see the directory structure (or debug errors such as not being able |
| 267 |
find help pages) is very difficult. The directory structure should be encapsulated |
| 268 |
in one file (perhaps an include file) so it can be easily altered or inspected. |
| 269 |
If encapsulation of say the spec reading routines is desired then they should be |
| 270 |
initialised with the path to the spec files.</p> |
| 271 |
|
| 272 |
<p>Note that this spreading of directory |
| 273 |
names across the code has also lead to a duplication of code to find the database |
| 274 |
directory and hence the required subdirectory to several places in the code. |
| 275 |
Clearly there should be one place in any application where the database directory |
| 276 |
is found and after that individual subdirectories will be identified from this. |
| 277 |
(This was clearly the intent in help.c which has a helpInit function which is |
| 278 |
supposed to initialise a static variable to point forever at the directory |
| 279 |
where the help is to be found. This does not happen in fact and help.c did not |
| 280 |
find its help files correctly until recently.</p> |
| 281 |
|
| 282 |
</body> |
| 283 |
</html> |