Feature #2896
closed
Initialize default setting when adding id/key/cert in Pib
Added by Yingdi Yu over 9 years ago.
Updated over 9 years ago.
Description
When default setting (e.g., default id, default key, and default cert) does not exist, adding an entry will also automatically set the added entry as the default one.
For example, adding an identity when there is no default identity will make the identity as the default identity;
adding a key when there is no default key of the belonging identity will make the key as the default key of the belonging identity;
adding a cert when there is no default cert of the belonging key will make the key as the default cert of the belonging key.
- Status changed from New to Code review
- % Done changed from 0 to 80
commit:7d1f4572e81479f7f1911d46693e68f1bcf0bdae makes this initialization the responsibility of PibImpl
, which adds complexity every PibImpl
subclass.
Why not keep PibImpl
simple and implement this feature in Pib
?
In PibImpl is a database, such an initialization can be done more efficiently with DB support (see the implementation of PibSqlite3). If we do it in Pib, it may involve multiple function calls. Given Pib is expected to be implemented over a database, this should be reasonable design choice.
commit:726c07cb049114f8bd21684127797d969ee17c2d implements default setting with a SQLite database trigger.
This does not increase complexity.
Therefore, I agree with note-3.
- Status changed from Code review to Closed
- % Done changed from 80 to 100
Also available in: Atom
PDF