No description, website, or topics provided.
C# Boo Other
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.nuget
DslConfig.Abstractions
DslConfig.Boo
DslConfig.CSharp
DslConfig.ConfigurationFile
DslConfig.Engine
DslConfig.ILMerge
ILMerge
NuGet
UnitTests
.gitattributes
.gitignore
AssemblyInfoCommon.cs
DslConfig2013.sln
MIT-License.txt
README
README.md
TODO.txt
cleansolution.ps1

README.md

DslConfig

This configuration library is intended to give .NET Developers a simple, extendable, scaleable, fast, type safe possibility to configure all kind of .NET applications.

  • Autoreload
  • Simple
  • Type safe
  • Fast
  • Scaleable
  • Easy to use
  • Multiple configuration language
  • Separate operations and development
  • Easy detection of missconfiguration
  • Easy API
  • Logging
  • Hierarchical
  • Multiple applications
  • Multiple systems
  • Change and reload configuration on the fly
  • Easy access to database connections

see also https://github.com/johannes-brunner/DslConfig/wiki

Autoreload

If autoreload is enabled, every change to a configuration value is automatically recognized by DslConfig. The changed configuration values can be used directly without restarting your application.

Simple

  1. Just install DslConfig per NuGet
  2. Add a folder named config to your project
  3. Add a file Variables.var to the config folder and ensure this file gets copied to the output folder
  4. Start adding and using config values in C# or Boo language

Type safe

The config files get compiled, thus configuration errors are show immedatily with a proven error message format. The config values are real .NET types. Parsing of config values belongs to the past. Use the power of the C# and Boo compiler to your advantage.

Fast

Get your configuration values in less than 0.5 ms.

Scaleable

Start with a single application on a developer host and scale up your solution to multiple applications on multiple hosts with a single configuration solution. DslConfig grows with your solution as needed.

Easy to use

Accessing a configuration value is really easy.
var timeout = config.GetVariable<TimeSpan>("ConnectionTimeout");

Multiple configuration language

Just decide if you like C# or Boo as configuration language and write your configuration files (e.g. Variables.var) in C# or Boo syntax.
Example for C# Configuration
DslConfig.IConfiguration config = new DslConfig.CSharp.Configuration();
Example for Boo Configuration
DslConfig.IConfiguration config = new DslConfig.Base.Configuration();

Separate operations and development

Operations typically needs host or service specific configuration values which resides in the *.host or *.boo files of DslConfig
Developers typically needs configurable values (Variables.var) or service specific configuration values which resides in the *.var or *.boo files of DslConfig
I recommend putting all configuration values for operations in the *.host files and all configuration values for developers in all others files.

Easy detection of missconfiguration

The configuration files get compiled and therefore the compiler detects misconfigurations. Thus compilers are really a robust, very well tested and very well known peace of software, there is no better mechanism to check your configuration files for errors. Compiler error message are very specific. In most of the cases they tell you the line and column of the error in conjunction with a really good error message.

Easy API

In 99% of the time you will need
config.GetVariable<TimeSpan>("ConnectionTimeout");
To get the current service (application) use
config.GetService()
To get the host use
config.GetHost()
To reload your configuration (e.g. if autorelad is disabled)
config.Reload()
Thats all!

Logging

DslConfig uses the common.logging framework. Thus you can use NLog, log4net or any other logging framework you like. If logging is enabled DslConfig logs useful things like the configuration directory used and the configuration files are used. This really useful in complex enviornments and on application setup.

Hierarchical

DslConfig files can be structured in a hierarchical way to keep maintenance of config files simple, regardless of the size of your software solution.

Multiple applications

If your software solution consits of multiple applications, windows services, web applications, then DslConfig supports you to keep configuration of all that solutions in a central place. DslConfig supports config files for every single application or a single config file for all application.

Multiple systems

Multiple systems could be developer workstations, development systems, integration systems, staging systems, produciton systems and systems for specifc customers. If you have multiple systems, then DslConfig does support you to configure the different applications on those systems.

Change and reload configuration on the fly

DslConfig files are simple text files. You can edit the config files directly in your application (for example show the config files in a textarea of your web application) and reload the config files per config.Reload(). You can show any compiler errors to the user to be sure that the config files are valid.

Easy access to database connections

The *.host files of DslConfig does support you on common host depend tasks. In DslConfig there is a special syntax for configuring database connections and email services.

To configure and use a database connection use
DbConnections["DB1"] = new SqlConnection("Data Source=(localhost\\SQLExpress);Initial Catalog=DB1");
in your config file. You can access this connection in your code via
config.GetHost().DbConnections["DB1"]
Try http://www.connectionstrings.com/ to build your connection strings and see other data provider than sql server (SqlConnection) like System.Data.OracleClient.OracleConnection, MySql.Data.MySqlClient.MySqlConnection, ...

To configure and use a email service use
SmtpClient.Port = 25
SmtpClient.Host = "mymailhost.com"
in your configuraiton file. In your application use
config.GetHost().SmtpClient.Send(new System.Net.Mail.MailMessage());
to send a email.

For further details see https://github.com/johannes-brunner/DslConfig/wiki