Δευτέρα, Απριλίου 04, 2005

What now?

I think I've made two components that are quite functional at this point. As I review on how they are coded and designed I conclude that (implicitly) all I did was to try to mimic features of .NET dataset that client datasets lack (data relations in particular). On this post I'll just give a summary of what I think is left to be done, so that they may become even more useful:
  • Figure out a way of incorporating the UndoLastChange technique I show in my Interbase example application in component code (may be add a unit level procedure and something like UndoCdsKTList even though this will be very restrictive in that all CDSs should be placed inside a single form or datamodule and I don't know if this is thread safe).
  • Use Cds.SavePoint in conjunction with the previous method so that I can make 3 procedures (probably also at unit level) StartLocalTransaction, CommitLocalTransaction, RollBackLocalTransaction
  • The above two methods can be combined with re-introducing Cds.UndoLastChange, GetSavePoint and SetSavePoint (since none is declared as virtual) so that they become non- functional (care should be taken not to use for example standard TClientDataset Actions with my components- I should note that on my help file).
  • May be I should provide a way (probably bi- directional) of setting the primary key property in relation to pfInKey flag of a TField. I should also make primary key field readonly
  • I am not thinking of providing support for composite primary and foreign keys. This is much too complicated for me to handle.
  • I should probably support somehow all kind of field types (other than TIntegerField). What puzzles me though is how to provide AutoInc (or AutoDec) capabilities in these fields (I should probably let the user set the primary key value and not change it during applying updates- just use these fields to enforce client side constraints, or alternatively I could make the temporary values behave as integers (casting to and from and integer is rather easy) and let the user/ developer define the permanent value on my OnGetGenerator event)
  • Add support for circular references (and probably self- referenced datasets and drop support for hierarchical datasets as they are implemented right now since now it is very restrictive). What I think is very difficult to accomplish is to support the way applying updates is handled (related to circular references). For example, if I insert 2 records in two circular referenced datasets, then I should first "apply" the one that has TField.Required property of a foreign key set to false, then the other and then I should provide an "Update TableName ...." SQL clause to update the first table foreign key value. This is very difficult to accomplish and will make code very complex (any idea accepted).
  • A lot of discussion is made recently about VCL .NET and how useful it is (primarily in migrating existing Win 32 applications to .NET). I should probably provide support for Datasnap .NET, however my experience with .NET is very limited (for example I can't figure out how to provide a property editor on .NET).
  • May be I should convert my ForeignKeys property from string property to a collection property (making code more clear and helping in migrating to .NET)
All the above are quite a lot of work to be done (not to mention testing and bug fixing). However, I don't know if I can succeed all this on my own I have to say (.NET implementation in particular) . Besides, time will be limited from now on. (I start a "real" job and medicine is very demanding from time and personal resources perspective). This will depend on feedback and as long as it is minimal I am thinking of "freezing" the whole effort.
After all, the way my components work at this point covers (not to say exceeds) my personal needs and I am very happy about it. (I use Win32 and I use "surrogate" keys (see also section on surrogate keys) and I've been able to build a rather complicated medical record database application- Having 10000 drugs in a KTClientDataSet as a lookup table and being able to "download" new "definitions" as antivirus products do, is a design that satisfies my needs)