Just a further update.
I created a proof of concept app to test the points I raised on my
second question and am happy with the results.
I have the following projects:
Sample.Web - Main web application (entry point) - references
Sample.Core and Sample.Adapters
Sample.Core - Application services, interfaces, utils
Sample.Adapters - Portable area messages (e.g. LoginInputMessage),
handlers (e.g. LoginHandler) and any html extension methods specific
to the area e.g. Html.Login
Sample.LoginPortableArea - Portable area project. References
Sample.Adapters.
Based on Eric's earlier reply, the call to InputBuilder.BootStrap()
will include areas without explicitly referencing them from the main
web project.
I am using StructureMap to then scan the Sample.Adapters dll for
instances of IMessageHandler:
public AppRegistry() {
Scan(x =>
{
x.Assembly("Sample.Adapters");
x.AddAllTypesOf<IMessageHandler>();
});
}
In Global.asax I do the following:
protected void Application_Start()
{
Bootstrapper.Boot();
Bus.Instance.SetMessageHandlerFactory(new
IocMessageHandlerFactory());
foreach (var handler in
ObjectFactory.GetAllInstances<IMessageHandler>()) {
Bus.AddMessageHandler(handler.GetType());
}
...
This appears to work well and means that if I then add a new portable
area that should communicate via the bus, I need only to update the
Sample.Adapters dll and don't need to add any additional references to
the main web project.
> For more options, visit this group athttp://
groups.google.com/group/mvccontrib-discuss?hl=en- Hide quoted text -
>
> - Show quoted text -