L
Lloyd Dupont
I'm attempting to write a fairly complex data structure.
One part of the complexity is that all 8 data operations it supports
delegate some code to virtual method.
This is by design because I want the user to subclass the data structure and
be able to prevent changes to happen. and / or I want to notify observers.
The unfortunate side effect is: it seems there are no simple way to have all
user code run at the begining or at the end of the code.
Hence some user code might be called in the middle of an operation and cause
an unrecoverable error. (i.e. corrupt the data structure).
Do you think it's acceptable?
I am thinking there are 2 possibilities:
1. it's ok. Warn the user (in the documentation), these are critical data
method, mess them, mess the data!
2. data structure should be fool proof, stack all user change in a class for
this purpose and run them at the end
what do you think?
One part of the complexity is that all 8 data operations it supports
delegate some code to virtual method.
This is by design because I want the user to subclass the data structure and
be able to prevent changes to happen. and / or I want to notify observers.
The unfortunate side effect is: it seems there are no simple way to have all
user code run at the begining or at the end of the code.
Hence some user code might be called in the middle of an operation and cause
an unrecoverable error. (i.e. corrupt the data structure).
Do you think it's acceptable?
I am thinking there are 2 possibilities:
1. it's ok. Warn the user (in the documentation), these are critical data
method, mess them, mess the data!
2. data structure should be fool proof, stack all user change in a class for
this purpose and run them at the end
what do you think?