![]() |
|
#1
|
||||
|
||||
[GIM] Data Module - ContactContact Data Module
A part of the GIM project
Introduction For those that are not familiar with the GIM Project yet, you can learn more by reading this thread or on this initial project site. There are basically three main parts to make a GIM module as shown by the following diagram: Code:
gim.h is the controlling thread through which any User Interface should be able to hook up to any data implementation. This thread describes one manner in which the Data Implementation for the contact module can be done. Data Structure For this implementation, I have used my custom double-linked list structure. The doubly-linked list works extremely well for this type of use, as long as the data set is relatively small. Even then, the only place that the dl list really falls behind is when the entire data needs to be sorted (probably not noticeable until several thousand entries). This could be solved by writing an improved sort routine when the entire structure needs to be resorted. Also, this data implementation is a stand-alone version that reads a single file and writes back to that single file when done. This is great for a single user, but does not really lend itself towards shared usage. One of the rules of gim.h was that the control file itself and all functions that are prototyped therein shall adhere to C calling conventions. Although it is highly unlikely, there may be some pure C implementations of either the user interface or data interface. It makes for a little bit of a challenge in some areas, but with a global variable or two this is quite easy to overcome. Remember, only the function prototypes themselves need to adhere to C. The implementation can use any and all features of C++ as my data implementation does. Everything is implemented as described by gim.h. This includes custom sorting and filtering capabilites. Test User Interface In order to test the data implementation, I have written a console user interface. This is an extremely basic interface, but does allow full functionality of the contact module. There is absolutely no direct contact between this user interface and the data implementation. Therefore, this test user interface can be used with *any* data implementation. In fact that will be a requirement of anyone submitting an alternative data implementation. The test program uses the classical single letter menu. The following is what this menu looks like: Code:
A couple more things about the test program.
Still Needed This is the Alpha version of this module. It still needs to have more complete error checking built in, such as memory allocation failure traps. Also, like any program, it needs to be torture tested. I need to figure out what sequence of events causes problems. Does everything work as advertised? Is there a glaring ommision? Is speed adequate on slower machines with a decent size data set? Files I have attached all of the source files necessary to create the test program. If anyone wants binaries, I will post them to the website shortly. Another advantage to seperating these modules is the conciseness of the resulting code files. The following is a summary of the files and their corresponding sizes:
As long as all the files are under the same directory, the compile command is quite easy. For example, under gcc use: Code:
Summary The rest of this thread will go through some of the detailed implementation aspects of this module. I was interested in getting the full files posted for those interested in testing it out, so I decided to place my summary post first and attach all the source files. Comments, suggestions and even nicely worded criticisms are welcome. __________________
The best damn Sports Blog period. |
|
#2
|
||||
|
||||
|
I have uploaded a windows binary for those interested as well. I would really like to see any comments on this. It is not a fancy GUI, but it is a complete contact manager program. We will have a GUI shortly, but I really wanted to see some heavy duty crunching of this data implementation.
Download it here Fishing for comments... __________________
The best damn Sports Blog period. |
|
#3
|
||||
|
||||
|
I have downloaded the file, don't hold your breath waiting for me to install it!
![]() __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
A Week in Kuwait by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| [GIM] gim.h | dsmith | C Programming Language | 0 | 18-Jan-2005 08:48 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
| passing data in module | jack | Apache Web Server Forum | 0 | 07-Feb-2004 23:40 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The