Starting Work on Serialization Scheme for Instruments
This afternoon I started work on the serialization scheme for the Instruments in the greek engine I am working on. It's going to be interesting because we have come rather tricky multiple inheritance, so we're going to have to figure out exactly how to handle each object, but I think that's a little more bookkeeping and a little less genius.
The tricky part is the fact that we have references to other Instruments - say the Options on the Stocks, etc. Those are going to be a little tricky for while we can save the securityID of each instrument, we can't be sure everything is going to be serialized out in time for every link to be satisfied. In fact, it's almost a guarantee that we won't. So how to handle these type of links?
I think I have a solution using a subclass 0f Instrument that's simply a placeholder for the instrument - containing the securityID. Then, when I need to get at it, I can easily fault the data back in and carry on. It's not completely done in my head - maybe there's a fault class for every instrument type - maybe there's only one for all. Can't be sure until I get in there and find out what the limitations are and what I really need.
But it's a great little idea. Fun stuff.