|
NReco
Describes NReco Core Services.
CoreNReco core (NReco assembly) defines minimal infrastructure required for all components:
Type ConversionThis subsystem provides flexible and extensible mechanism for run-time types conversion (just as System.Convert for simple types). It simplifies components interaction (especially when their configuration was automatically generated from models) by encapsulating all work related to types casting and conversion. ConvertManager class provides simple access to this mechanism: var h = new Hashtable { {"a", "b"} };
var dict = ConvertManager.ChangeType<IDictionary<string,string>>( h );Standard converters are:
<configSections> <section name="nreco.converting" type="NReco.Converting.ConvertManagerCfgHandler,NReco"/> </configSections> <nreco.converting> <converter>NReco.Winter.Converting.NiOperationConverter,NReco.Winter</converter> </nreco.converting> Don't forget to initialize you configuration: ConvertManager.Configure(); LoggingBecause of a lot of abstraction layers models debugging may become an nontrivial task. .NET platform has at least 2 approaches to do that:
class MyClass {
static ILog log = LogManager.GetLogger(typeof(MyClass));
protected void MyMethod() {
int myVar = 0;
log.Write(
LogEvent.Error,
new{Action="some event description",myVar=myVar} );
}
}Component CompositionNReco.Composition introduces POCO-components composition model. Central interfaces are IProvider<,> and IOperation<>. They represents 2 main concepts from NReco upper-level ontology:
ProvidersStandard providers are:
OperationsStandard operations are:
|
Sign in to add a comment