Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



LearnNow


XAMALOT
 


SSWUG

Reader rating:
Click here to read 2 comments about this article.
Article source: CoDe (2005 - May/Jun)


Article Pages:  1  2 3 - Next >


Using the CMAB for Enterprise, Client, and User Settings

Applications use many forms of configuration data, storing settings that are used in applications, enterprise, client computers, and user settings. The Configuration Management Application Block (CMAB) is typically used for application settings, but it can be enhanced to support more complicated settings as well.

Virtually all applications require some form of configuration data. Enterprise configuration data includes settings that are global to the organization, including items such as the organization's name, address, and logo. Perhaps more importantly, enterprise configuration may include information such as the address of the enterprise LDAP server or authentication service.

"
The simplest way to use the CMAB to store enterprise settings is to use a centrally-located XML configuration file.
"

Client configuration data includes settings that are global to all applications on a client computer. Often, this includes a flag indicating whether the client is a production, test, or development computer. Sometimes the configuration data includes paths to log file locations or other system-level policy settings. Configuration data may also include overrides for enterprise configuration that forces applications to use a test server instead of a production server, for instance.

Application configuration data includes settings that are global to all users for a specific application. Often, application configuration includes settings to configure remote server addresses, local caching, or connection strings. These settings may include overrides for enterprise or client computer configuration settings to provide application-specific requirements.

User configuration data includes settings for specific users of a specific application. This type of data must be stored in a per-user location and preferably supports the concept of roaming user profiles. The primary options for storing user configuration data are isolated storage, the user's Application Data directory, or the registry.

Although the .NET Framework itself provides no direct support for managing client computer or user configuration data, with minor enhancements, the CMAB can be used to manage this data as well.

Enterprise Configuration

The CMAB is often used to read and write configuration data from the application's configuration file. It can also be used to read and write configuration data from other arbitrary XML files as well as the Windows registry or a SQL Server database.

By using the ability to read and write to arbitrary XML files or a SQL Server database, you can use the CMAB to access enterprise configuration data. All that is required is either a central enterprise XML file on a network share or a centrally available SQL Server database that can be used by any application. If either of these conditions can be met, you can use the CMAB for this purpose.

If these conditions can't be met but the data is in some other centrally available location, you could write a custom storage provider to allow access to those settings. An example might be a centrally available LDAP server that contains all enterprise configuration data. You could write an LDAP storage provider that plugs into the CMAB to read from this data store. Writing such a provider is outside the scope of this article.

The simplest way to use the CMAB to store enterprise settings is to use a centrally-located XML configuration file. This is exactly the same as storing any other XML configuration data using the CMAB with the exception that the CMAB is configured to reference the XML in a specific file on a shared network drive.

In the case of Listing 1, the path attribute is used to indicate that the settings are stored in a specific file other than the application configuration file. As long as the H: drive is available enterprise-wide, you can use this technique for enterprise settings.

&

By: Rockford Lhotka

Rockford Lhotka is the author of several books, including the Expert VB and C# 2005 Business Objects books and related CSLA .NET framework. He is a Microsoft Regional Director, MVP, and INETA speaker. Rockford is the Principal Technology Evangelist for Magenic (www.magenic.com), a Microsoft Gold Certified Partner.

rocky@lhotka.net

Fast Facts

Although the .NET Framework itself provides no direct support for managing client or user configuration data, with minor enhancements, the CMAB can be used.



Listing 1: Configuring the CMAB for Enterprise Settings
<section 
  name="EnterpriseSettings" 
  type= _
    "AppConfig.EnterpriseSettingsSectionHandler, 
     AppConfig, 
        Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />

      . . .

<configSection name="EnterpriseSettings">
  <configCache enabled="true" refresh="1 * * * *" />
  <configProvider 
     assembly=
"vbAppSettings,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null"
        type="vbAppSettings.Storage.XmlFileStorage"
        path="h:\enterprise.config"
        signed="false" 
        refreshOnChange="true"
        encrypted="false" />
</configSection>


Article Pages:  1  2 3 - Next Page: 'Client Computer and User Configuration' >>

Page 1: Using the CMAB for Enterprise, Client, and User Settings
Page 2: Client Computer and User Configuration
Page 3: Client Computer and User Configuration (con't)

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
4.1 out of 5

7 people have rated this article.

Instantly Search Terabytes Of Text
“Lightning Fast”
– Redmond Mag
“Covers all data
sources” – eWeek
25+ fielded & full-text search options
dtSearch’s own document filters highlight hits in popular file types
Web Spider supports static & dynamic data
APIs for .NET, Java, C++, SQL, etc.
Win / Linux (64-bit & 32-bit)
www.dtSearch.com
 

      LearnNow

 

SSWUG