Linked Questions
12 questions linked to/from What in the world are Spring beans?
0
votes
1answer
138 views
Spring MVC Declaring bean to use @Scheduled [duplicate]
I'm trying get a class to request data from a rest api periodically to check if the data I have in my database is still up to date.
The documentation says that to enable scheduling I should add the @...
1933
votes
38answers
527k views
What is Inversion of Control?
Inversion of Control (IoC) can be quite confusing when it is first encountered.
What is it?
Which problem does it solve?
When is it appropriate to use and when not?
1909
votes
19answers
600k views
What is a JavaBean exactly?
I understood, I think, that a "Bean" is a Java class with properties and getters/setters. As much as I understand, it is the equivalent of a C struct. Is that true?
Also, is there a real syntactic ...
116
votes
11answers
146k views
What is Dependency Injection and Inversion of Control in Spring Framework?
"Dependency Injection" and "Inversion of Control" are often mentioned as the primary advantages of using the Spring framework for developing Web frameworks
Could anyone explain what it is in very ...
4
votes
2answers
4k views
What is the advantage of autowiring in spring
What exactly is the advantages of autowiring is Spring?
An example of autowiring in spring would be like
public class TestClass {
testMethod() {
// .....
};
}
public class MainClass ...
4
votes
2answers
661 views
what is the difference between using or not Spring Beans?
Probably i'll get a lot of downvotes, but it's so confusing for me all this fact of whether use beans or not. Lets suppose this example
interface ICurrency {
String getSymbol();
}
public ...
0
votes
3answers
595 views
Wiring Database Object with Spring Bean
From Spring in Action book, there is an example of Spring Bean. It uses Compact Disc analogy. When an application needs a "The Beatles" album, it creates "The Beatles" album bean, and as well as other ...
-1
votes
2answers
951 views
Could not autowire. No beans of type 'int' found
I'm working with Spring Boot and I'm having a little trouble understanding Beans. I'm led to believe Beans replace the new keyword.
I identified when using just Autowire my Beans wouldn't create a ...
4
votes
1answer
242 views
Spring Static methods
I am learning Spring, and the book I am reading has the following code line
@Bean
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
return new ...
0
votes
0answers
288 views
Grails instantiating vs injecting a service
In Grails, we can inject a service into a controller. But often we might want to inject services elsewhere as well (for example in a quartz job).
I have faced issues injecting Grails services in a ...
0
votes
3answers
106 views
Whats bean in spring and what is not
lets say I have code like this:
@Repository
public class Foo{
}
@Service
public class Boo{
@Autowired
private Foo foo;
}
so now what here are we calling bean? Bean is the object of Foo type of ...
-2
votes
2answers
45 views
How to use @Autowired annotation two or more different Component class for same service?
For example, have a class like as follows.
First XService service in class A is not null but second XService service in AmountValidator is null.I get NullPointerException I try to create bean new it ...