Another project on my mind
Yesterday I had an idea for a new project. Ok, so what’s new with that? I always have ideas.
Well, firstly, I still haven’t made too much progress with the previous project(s), including the Aussie Geek Ring project.
And next up, it’s on deciding how I should go about it.
Ok, let me ellaborate a bit.
What I have planned to develop is a Windows based app using .NET that has a relatively small distributable footprint (that is, it can fit on a floppy, if the user already installed the .NET Framework).
Although it is likely that many individuals that would try out my app, would have .NET installed, not many will have something like SQL Server installed.
So I thought about it some more, and thought about storing data in XML files. But that didn’t seem like a good idea either.
Thought some more, and remembered my Industrial Experience (IE) project that I did last year.
We used object serialisation in Java to implement our data storage solution.
Now i’ve ended up thinking about doing something like that, but for using .NET.
So, now I have a mini-project that will fit into a bigger project.
I would love to discuss what the bigger project is, but I’ll save that for a later post.
Looking back, it was an interesting idea at the time, but perhaps there may well have been better solutions.
But it was effective and served its’ requirements.
Due to time constraints, we only implemented object (er, mostly just string) based queries.
One class that we created was called AddressBook.
By default (as per our set requirements), AddressBook had 3 fields. They were, Name, Surname and Mobile Number.
Another one of our requirements was to allow for custom table fields.
Our Vector was filled with firstly, the 3 default fields (basically, fieldname and field type were stored in the Vector).
We had another class called FieldInformation had 3 fields, acceptedTypes (yep, acceptable data types), name (field name basically) and type.
Ok, I wasn’t very clear about this, but what the Vector contained was multiple FieldInformation objects, and the FieldInformation objects contained the different field information (fieldname and data type).
I thought that was quite a good approach (at the time). We wrote more classes though (a lot more
), we also had a class called Contact.
Contact actually contained the field data (to complement FieldInformation class that only contained information about the actual field names and their data type).
Anyway, i’ll just do a quick list of classes related to AddressBook and get on with the original intent of this post.
AddressBook.java
Contact.java
CustomField.java
Database.java
DataStore.java
FieldInformation.java
Group.java
Now a quick summary of each:
- AddressBook contained 2 ArrayLists, and one Vector. One ArrayList contained objects of type Contact and the other contained objects of type Group. The Vector, as previously stated contained objects of type FieldInformation.
- Contact is where all the contact information was stored. We had one Vector field which contained all the data for the custom fields.
- CustomField was an interesting one. Because I don’t really remember it, and i’d rather not spend my entire lunch trying to figure it out either. Maybe another day/time.
- DataBase. So, what the heck is the DataBase class you ask? The DataBase class contained the AddressBook object. Being an object, we could very easily just create another object called AddressBook2 or something, and we’d instantly have a second addresssbook (which was one of the requirements of that project).
The DataBase class was like the “mother” class. Whenever data was stored within the app, it would be stored via the DataBase class.
We stored all our data in objects contained within the DataBase class.
The DataBase class serialised itself to disk so we could store our data for usage later down the track.
It could also read the serialised data.
- DataStore. Well, we had a problem, if we wanted to access the Database, we’d need to create a new class, right?
Or possibly even create static methods in our DataBase Class.
After a bit of thinking, we concluded that if we can’t make the DataBase class static, we should create an instance of it in another object and make that static.
So what ended up happening was we created the DataStore class, which contained only one object. Yep, that was the DataBase object. [Basically we had: public static Database db = new Database();]
- FieldInformation I’ve already fairly much covered.
- Group was just a very basic class that contained within it only two fields. One was the “primary key”/unique identifier of the Contact, the other was a Group Name.
Ok, there is a good reason why I went through all that. The project that i’ve “dreamt up” require does potentially require some of what i’ve listed above.
Sure, going by the own database method does mean more time needed for development, but it could offer a more flexible solution.
I know that I could probably just use MS Access, or even SQL Server 2005 Express Edition. I’m not sure about SQL Server 2005 Express, but MS Access is very inflexible.
Utilising some of the O/R stuff with SQL Server 2005 Express would be interesting, but is that an ideal solution for a simple desktop app?
One little thing that does worry me though is how well would my customised database solution work if the end user needed to search through say 100,000 records.
I need a solution that would work fast, given the number of records. I need it to allow me to spit something out quickly.
I know that my IE project probably had some elements of bad design within it. Looking back at it, I would probably change many things, but at the time, that was the best solution 2 final year uni students could think up, so that’s what we stuck with. (Java was the preferred development language by our client).
I have also decided for this project that i’m going to do, it’ll be done using nothing but Visual C# 2005 Express Edition.
This will also help shape my database solution, as it’ll allow me to use Generics. This means no more boxing/unboxing!
Another reason for VC# 2005 (and to a lesser extent, the Express Edition) is because I want to do something that allows me to learn more about version 2.0 of the framework.
I think that is one way to keep me interested, since I always love playing with new technology.
Maybe it’s just me not having played with .NET 2.0 much, but has anyone seen something like the DataBound ListView in .NET 2.0?
I know I could just port it over to .NET 2.0, but since I haven’t really looked at .NET 2.0, does anybody know?
The ListView would look nicer to display my data items in the project, rather than the DataGrid (or the DataGridView as it is now referred to in .NET 2.0).
The great thing about the ListView is you can do different views, much like you can in Explorer.
Anyway, hopefully by the end of the weekend I’ve got more time to nut things out and figure out all the intricate little details of this project.
In all likelihood, this project will be released under some form of Open Source license. Not sure which yet, there seem to be plenty of them.
If this project does get off the ground, which I hope it will, (if I put enough effort into it), the next step would be see if there is any interest out there from people who would like to get involved.
Perhaps i’ll offer the possibility of joining the project once i’ve figured out what exactly I want to do.
Who knows, i’ll figure that stuff out later, for now i’ll just try get all the “high level” ideas of the possible uses and so on of this project onto paper (actually, into OneNote).
I’ve got way too many ideas right now that are just swimming around my brain, just haven’t had the time to write it down (but have put a few of the major ones into OneNote).