|
|||||
|
|||||
OverviewSamplesUser Reference DocumentationProject InformationMisc |
NanoContainer.NET
NanoContainer.NETSo what is NanoContainer? NanoContainer is a complimentary API for defining PicoContainers. The NanoContainer.NET (or Nano.NET for short) implementation differs slightly from what has been developed for the Java implementation. Nano.NET takes advantage of the Comparison of NanoContainer for Java with NanoContainer.NETThis section is useful for those familiar with the Java implementation of NanoContainer. An example of the differences are defined below. NanoContainer for JavaNanoContainer for Java relies on creating an API that is similar in nature to that of PicoContainer but based solely on the use of Strings. From a highlevel view, a script is parsed and components are added to an instance of NanoContainer by its String representation (i.e. NanoContainer.NETThe Nano.NET implementation does not require the use of a concrete NanoContainer class. Scripts are loaded and executed dynamically. There is no need for an intermediate step to parse each script into an instance of a NanoContainer. The result of running a NanoContainer script is an instance of I want to see an example!So for the impatient lets take a quick look at how we would utilize Nano.NET. The following script registers an implementation ( C# Script example Now there are 2 important things to notice with the above example.
It is also possible to define your script as an implementation of the
Now that we have a script defined we need to load the script so it can be used by NanoContainer.NET. The following example shows the necessary code needed to load the script and build the associated container Loading the script from within your .NET application What languages can be used for scripting?
NanoContainer.NET also supports .NET Attributes for defining contents of a container but then that really doesn't fit under the "Scripts" definition and therefor not listed as a scripting option. |
||||
|
Copyright 2003-2006 - The Codehaus. All rights reserved unless otherwise noted.
Powered by Atlassian Confluence
|
|||||