So, I'm new to using Castle Windsor and I'm struggling with how ugly my Controllers are becoming. I've got IOC working in my project which seems to be at least half the problem for most people. Now I'm finding that I'm declaring a ton of dependencies in my controller constructors as below. Are there any good patterns for managing these so I'm not copying/pasting this into each new controller and/or section of the site I create?
public HomeController(ILocalizationService localizationService, // ugly
INewsService newService,
IAnswerService answerService,
ITwitterFeedService twitterService,
IFacebookService facebookService,
ISettingsService settingsService,
IExternalDataService externalDataService,
IUserService userService,
IInstantMessageService instantMessageService,
ICalendarService calendarService,
ILogger logger)
{
// do some stuff to link these up
}
Hope this makes sense. I can add more details if necessary to clarify.