Changes between Version 3 and Version 4 of KeysRefactor
- Timestamp:
- 08/03/09 09:39:37 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
KeysRefactor
v3 v4 1 === Update ===2 3 Good idea. Will not work. Consider next PIR code:4 {{{5 $S0 = "foo"()6 $P1 = $P0[$S0]7 }}}8 9 In this case {{{[$S0]}}} will have type {{{KEY_string_FLAG | KEY_integer_FLAG}}} but store integer value of used register. I need something different. Or not to touch Keys at all and treat them as "unavoidable evil"...10 11 12 1 === Idea of refactoring Key PMC === 13 2 … … 19 8 1. Add {{{KeyItem}}} interface class to represent single abstract step. 20 9 21 2. Implement {{{StringKeyItem}}}, {{{IntegerKeyItem}}} and {{{PMCKeyItem}}} to store concrete value for each step.10 2. Implement {{{StringKeyItem}}}, {{{IntegerKeyItem}}}, {{{PMCKeyItem}}} and {{{RegisterKeyItem}}} to store concrete value for each step. 22 11 Such {{{FooKeyItem}}} will implement {{{get_foo}}} vtable methods, freeze/thaw and nothing else. We don't need FloatKeyItem because float keys are meaningless. 12 {{{RegisterKeyItem}}} will store tuple {{{register_type, register_number}}} to reference particular register. 23 13 24 3. {{{FooKeyItem}}} will not be directly constructable by throwing exceptions from {{{init}}} and {{{init_pmc}}} 14 3. {{{FooKeyItem}}} will not be directly constructable by throwing exceptions from {{{init}}} and {{{init_pmc}}} 25 15 26 4. Re-implement Key as: 16 4. {{{RegisterKeyItem}}} will be directly constructable and implement {{{set_integer_keyed_int}}} method to set {{{register_type}}} and {{{register_number}}}. 17 18 5. Re-implement Key as: 27 19 28 20 a. RPA for storing *KeyItem.