I recently stumbled upon the following Configuration Injection Framework. Seems interesting and seems to fit my needs. Has anyone tried it or knows about some other Configuration Injection frameworks? As far as I know Spring and Google Guice does not support this kinds of injection?
In Spring you can do something similiar with the PropertyPlaceHolderConfigurer, look at http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch04s07.html#beans-factory-placeholderconfigurer
Constretto with spring may provide what you need. Spring also does most of these things, especially in version 3.0
Related
Good Morning everybody,
I am currently facing the problem that my project wants to use weld-junit (https://github.com/weld/weld-junit/blob/master/junit5/README.md) to provide easy unit tests, wit the power of injection and a CDI container. In an isolated context this works great but in combination with spring data JPA, I am currently facing the problem that the repository implementations (generated by spring data) cannot be found in the CDI context of the test, so the injection points cannot be fulfilled. Does anybody has experience by using this combination yet? Wolfs be great to have an example.
Kind regards
I have seen a Spring application, and it uses spring dependency injection in addition to that some places I find Java Dependency injection. I am not sure why Java DI is used. I googled it, however, I can’t find an exact answer.
Anybody can explain why Java DI is used in addition to Spring DI?
Dependency Injection in Java is a way to achieve Inversion of control (IoC) in our application by moving objects binding from compile time to runtime. We can achieve IoC through Factory Pattern, Template Method Design Pattern, Strategy Pattern and Service Locator pattern too.
Spring Dependency Injection, Google Guice and Java EE CDI frameworks facilitate the process of dependency injection through use of Java Reflection API and java annotations. All we need is to annotate the field, constructor or setter method and configure them in configuration xml files or classes.
This link may help you more
To be simple, If you need Dependency Injection through Java you need to implement using some Design Patterns, which is time consuming. Frameworks like Spring helps to implement DI using annotations and configurations which are developed using specific design patterns. As a developer we need not worry about DI, we can just concentrate on our business logic.
Spring Framework provides a wonderful abstraction layer for low-level resource access in Java (the Resource and ResourceLoader interfaces). I'm developing a library which should not be dependent on Spring, and am looking for an equivalent for this capability in a stand-alone Java library. Anyone familiar with one?
Why not just use the one from Spring by itself? It doesn't look like it has any dependencies on the rest of Spring.
Edit
Not sure I understand the problem - you want something that does exactly the same thing, but doesn't come from Spring? Is it a licensing issue?
You only need half a dozen classes from it, if you don't want to add them as an extra jar, move them to your own namespace (good idea anyway, in case you do use Spring at some point, after all) and distribute with your library. Again, assuming your licensing allows it.
If licensing isn't the problem, can you be more specific about why you can't use the Spring implementation in your own library?
You can use Jsr-303 (DI) to match your requirments. The most known implementation is Google Guice. It's a javaEE standard (maybe JavaSE).
Interested to know how many are using BeanBuilder in production as a replacement to XML based config for Spring 3.x?
How would you go about doing that? It's been proposed that the Grails bean builder be added to Spring in a future release but that hasn't happened yet.
For instance, I am using JSF + custom framework developed in our company. Now I want to use a third party validation framework that can be used as an plug-in and it should not create any dependency what ever may be the technical stack.
So my question is does spring provide any framework of that sort or if it's available how can I use that?
I am expecting a validation framework something like, which is configurable through XML.
Spring does have a validation framework, but if you want minimal dependencies, then I'd suggest that you go with a Bean validation provider. It's a new(ish) official validation standard, defined in JSR-303.
There are several implementations at the moment. I'd give Hibernate Validator a look.
I disagree. Hibernate Validator is an awful piece of software (at least the versions that were current about a year ago). Spring Validation is a nice piece of software, that goes together well with the BeanWrapper interface.
But it's true: Spring Hibernate resides inside the Spring Context jar, which is unnecessary overhead. Hopefully there will be a separate version sometime.