Game Development Reference
In-Depth Information
no size limit on the amount of data that could be stored. One of the biggest prob-
lems with INI files is deciding where to place the physical files, which is not an issue
with the registry because it is globally accessible. The registry solved a number of
problems with INI configuration, but other problems were introduced in doing so.
With all configuration data for the system stored in a single location, the entire
system slows down at an exponential rate as more entries are added. Having large
amounts of configuration data in the same place also makes finding a particular
entry challenging. Additionally, the registry is only accessible via an API, so backing
up configuration info is extremely difficult. Security is also a big concern, because
it can be risky to allow application access to the registry to save a few configura-
tion settings, especially if the application is untrusted. Lastly, the entire system
depends on the registry, so any accidents using the regedit tool can cripple the
operating system.
The .NET framework introduced application configuration files that allow appli-
cations to be configurable without the need for recompilation of source code. This
approach is widely used by .NET applications, but a major limitation is that this is
a read-only mechanism, because ConfigurationSettings does not support writing.
The app.config files can be manipulated as normal XML documents, but this con-
sidered a hack and bad practice.
A custom solution could be used to save settings as either binary or text to regular
files, but then there are even more deployment and maintenance issues that arise.
Issues like data protection, where to save the files, and additional code to support
loading and saving these files must also be written.
The ideal solution to the mentioned problems would be a mechanism that can
separate files per application or per Windows user so that multiple users on the
same machine can have their own settings. The ability to save arbitrary data is
important, especially if the proposed solution is intended to be generic and widely
reusable. Data should be storable in a variety of formats such as flat text, hierarchi-
cal, or binary. Lastly, the mechanism must be secure, so that untrusted callers like
downloaded executables cannot access sensitive system information. Microsoft
introduced another approach with the .NET framework called isolated storage that
is the recommended approach when the need for data persistence arises.
Concept of Isolated Storage
Isolated storage is basically a virtual folder that only your application can access.
You can create files and directories in your isolated storage and treat it pretty much
like normal disk space. Application users never have to actually know where data
Search Nedrilad ::

Custom Search