PtSettings
Advantages
- Ease of use for settings:
- Easy to access settings
- Easy to add new settings
- Easy to add new settings groups
- Ease of use for storages:
- No need to code reading and writing of settings (exceptions are lists of settings)
- Loading, saving and deletion of settings are one liners
- Changing storage is a one liner
- Can generate new settings units using PtSettingsExpert
- Flexibility with storages. (A storage could be an .ini file, XML document, etc.)
Applications generally do not need to know what types of storages they use:
- Storages can be replaced both at runtime and designtime
- New storage types can be made and then used at will
- Storage proxies can be made that decide where and how to store settings (see Demo5)
- Extra uses:
- Settings can be sent across the net in XML format
- Settings could be stored in a memo field in a table in XML format (see Demo4)
Disadvantages
- Coding required:
- Lists of settings require special coding (see Demo7)
- Lists of settings groups require special coding (see Demo8)
- Limitations:
- Without extra coding, settings names must be system names because they are the same as the names of properties in Dephi objects.
(ie. must consist of ['a'..'z', 'A'..'Z', '0'..'9', '_'] and not begin with a numeric character)
- Cannot access default settings (ex. (Default) in Registry keys)
- DeleteAll(nil) raises an exception (intentional) for TRegSettingsStorage
- Using Delphi Enterprise XML support requires calls to CoInitialize and CoUninitialize
- The MyXML unit is not currently supported
(may change due to popular demand)