Thanks,
Shantha Dodmane
Tim Driven Development | Test until the fear goes away
Shantha Dodmane wrote:
I'm much comfortable with Spring using annotations.
salvin francis wrote:
Shantha Dodmane wrote:
I'm much comfortable with Spring using annotations.
Don't you think that its simpler to make changes in a single config file without touching and re-compiling your code ?
salvin francis wrote:
Shantha Dodmane wrote:
I'm much comfortable with Spring using annotations.
Don't you think that its simpler to make changes in a single config file without touching and re-compiling your code ?
OCMJEA - In progress - studying, OCPJP 7 - 90%, OCAJP 7 - 93%
http://silviuburcea.blogspot.ro/
Martin Bechtle wrote:
I strongly disagree.
Martin Bechtle wrote:
I use Java because it's type safe: I know that even if it may contain bugs, my code runs correctly. Compilation takes less than a few seconds.
Martin Bechtle wrote:
Debugging an XML file because you mistyped something takes a lot more.
Martin Bechtle wrote:
It's the same as dynamic languages vs static languages: you gain productivity by writing less lines of code, but then you loose it again by debugging all the time.
Martin Bechtle wrote:
Beans and dependency injection, instead, should be done in your code
salvin francis wrote:
Martin Bechtle wrote:
Debugging an XML file because you mistyped something takes a lot more.
This is quite subjective to opinion. Even Spring will cry if I try to assign Onions to Animalsand would directly point it out.
salvin francis wrote:
Martin Bechtle wrote:
Beans and dependency injection, instead, should be done in your code
Why ?
Martin Bechtle wrote:
Beans and dependency injection, instead, should be done in your code
salvin francis wrote:
Martin Bechtle wrote:
Beans and dependency injection, instead, should be done in your code
Then why inject at all?
While I could agree with you over the using annotations for transactional purposes, etc.. I would definitely not prefer dependency injection via code.
Martin Bechtle wrote:
Am I missing something that you find really useful with XML config?
Martin Bechtle wrote:Am I missing something that you find really useful with XML config?
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:
Martin Bechtle wrote:Am I missing something that you find really useful with XML config?
Let's say my application supports MySQL and Oracle databases. I have written DAO's for both and I'm using Spring to inject the Oracle DAO into some other service class.
Let's say my customer now decides that they've had it with paying Oracle oodles of cash in licencing and they want to switch to MySQL. No problem, I can reconfigure my application without having to produce and version a new build. Just a Spring xml config change and a server reboot. Job done.
That's one example, of course there are others.
Martin Bechtle wrote:Is it possible to keep the XML outside the war/jar package? In that case it would really make sense.
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:
Martin Bechtle wrote:Is it possible to keep the XML outside the war/jar package? In that case it would really make sense.
You can do that yes, but I'd not be entirely comfortable with that. Spring xml configs are heavy on implementation detail quoting class names with full package prefixes which aren't super friendly to application support and configuration maintenance people. Plenty to get wrong, and get wrong big.
In our application we use Spring xml configuration for everything but our MCV controller classes for which we use annotations. We also use Spring Profiles to selectively enable and disable certain bean wiring configurations in our xml. For example:
Now the configuration switch item is outside of the Spring xml file.
Don't get me started about those stupid light bulbs. |