in their book head first design patterns, the four coauthors lay out a series of key principles for creating robust software designs. one of the most important of these principles is "find what varies and encapsulate it." in this article, lets apply this principle to the use of configuration files and explore the support for old-style .ini files and xml files.
"find what varies and encapsulate it" is what most of us do for a living. the heart of any programming language is a variable - a name/value pair. although we programmers are so used to a variable that it seems the most natural of things, people without a programming background dont find it natural at all.
what exactly is a variable?
... 下一页