S
shapper
Hello,
I am starting with IoC and I am creating modules as follows:
private class DomainModule : NinjectModule
{
public override void Load()
{
Bind<IProductRepository>().To<ProductRepository>();
}
}
private class ApplicationModule : NinjectModule
{
public override void Load()
{
Bind<IEmailService>().To<EmailService>();
}
}
So when using IoC I suppose for all services and repositories I should
have an interface, right?
And should the interface be in the same namespace then the class
itself?
Should I separate maybe in two folders? I have no idea what do call
the folders ...
Should I call the modules differently like:
DataModule and MailModule, ...
My project has 4 levels:
Infrastructre (Basic code to all levels)
Domain (Repositories, Entities)
Application (Services to deal with Email, Flash, PDF and Image
manipulation, Google, Twitter, etc)
Presentation (Web Site)
In presentation I am injecting the repositories, services, etc on
presentation classes.
Well, I am just starting with IoC to hopefully solve some problems I
was having on my project.
Thank You,
Miguel
I am starting with IoC and I am creating modules as follows:
private class DomainModule : NinjectModule
{
public override void Load()
{
Bind<IProductRepository>().To<ProductRepository>();
}
}
private class ApplicationModule : NinjectModule
{
public override void Load()
{
Bind<IEmailService>().To<EmailService>();
}
}
So when using IoC I suppose for all services and repositories I should
have an interface, right?
And should the interface be in the same namespace then the class
itself?
Should I separate maybe in two folders? I have no idea what do call
the folders ...
Should I call the modules differently like:
DataModule and MailModule, ...
My project has 4 levels:
Infrastructre (Basic code to all levels)
Domain (Repositories, Entities)
Application (Services to deal with Email, Flash, PDF and Image
manipulation, Google, Twitter, etc)
Presentation (Web Site)
In presentation I am injecting the repositories, services, etc on
presentation classes.
Well, I am just starting with IoC to hopefully solve some problems I
was having on my project.
Thank You,
Miguel