|
|
|
|
|
by stitchy
5076 days ago
|
|
"So if you like constructor injection you have two options: component scanning or XML." I only half agree that this is a limitation. I use as little component scanning as possible. I think it's better to scan for the configuration classes (hopefully there aren't many) and explicitly define the rest. I like this for two reasons, first for speed and second because everything is defined in a fairly central place. I can't tell you how many times I've been surprised by annotation based configuration. Personally I like Spring's Java Configuration over Guice's. It's more flexible for my needs. Although I suppose that an argument could be made that that's the problem: configuration over convention. I'm glad you mentioned the Guice style @inject is available with Spring now. I wasn't aware of that. |
|
So, approaches may vary.