Alo Sarv
lead developer

Donate via

Latest Builds

version 0.3
tar.gz tar.bz2
Boost 1.33.1 Headers
MLDonkey Downloads Import Module Development
Payment completed
Development in progress.
Developer's Diary

Thursday, December 09, 2004

Rewriting Range Management Subsystem

As mentioned in earlier blog entry, the key to finishing this app is simplifying. Writing the ed2k module showed where the flaws in the core design lied, and now it's time to fix 'em. You know when a subsystem is doing it's job and doing it good when you completely forget it's existance (same applies to any kind of computer software - or almost anything else for that matter). There are two subsystems that constantly remind of their existance tho - range management subsystem, and event subsystem. Both are rather fundamental parts of the core, and used heavily, so they need to be convenient.

Starting from Range Management Subsystem, I spent yesterday and the better part of today figuring out the public interfaces and overall design of the new engine, and now I'm rather satisfied how simple the thing became. The original system relied heavily on policy classes (hey, I had just learned the policy classes design concept when I first wrote it, and I clearly overused it there) - and policy classes change type, so in the end I had to convert ranges from one to another policy manually everywhere - tedios, error-prone etc. New engine gets away without any policy classes, and I also threw out a lot of things that are beyond the scope of RMS - namely FullRangeList concept (which did min/max border checking), and DataRange (which, in complex cases, also performed data buffers splitting/merging - with memcpy/malloc/realloc - *uff*). While it's not of any target, I estimate that the new subsystem will be <500 lines of code including documentation, compared to old 2000-line monstrum.

However, while the public interfaces are figured out, I still need to re-implement most of the internals (the old subsystems internals could partially be reused, however I believe I had some bugs in there - which resulted in those currupt downloading capabilities we'r seeing in CVS right now), so I'm writing the internals again from scratch.

After that's done, I need to review PartData and possibly simplify the systems there to make it safer/more usable too. If successful, the overall maintainance and future modules' development time should be lowered considerably by these improvements, so it's well worth spending time on right now.

Madcat, ZzZz

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?