Reusing

Project parts can be reused for different purposes. One can take advantage of Commands and Core modules reusing necessary parts.
It is possible to use both facade services as well as commands. In order to do that it is necessary to add assembly references
to particular modules (BSDS.Core and BSDS.Commands).

It is necessary to initialize both modules. Sample code can be found below:
 using (var bsdsEngine = new BsdsEngine())
 {
       bsdsEngine.Initialize();

       var dispatcher = new CommandsModule().Build(bsdsEngine.Services);
       var parameters = new CommandLineParser().Parse(args);

       dispatcher.Dispatch(parameters);
 }

First a BsdsEngine is created and initialized. It exposes Services property which plays a role of a service locator.
Next core services are used for CommandModule initialization.

Last edited Jun 30, 2011 at 2:49 PM by bwasielak, version 5

Comments

No comments yet.