summaryrefslogtreecommitdiff
path: root/spring-framework/04-basic-no-xml-java-configuration/README
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-04-25 21:53:33 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-04-25 21:53:33 +0530
commit4afcff940551079617e8f4116e52bb0ef9df7fcc (patch)
treecbaed6a2a53c7d032bfafaa38b94e4fc607f3e76 /spring-framework/04-basic-no-xml-java-configuration/README
parent7b08f1155e1cb8bf263c3570eeb119970407a037 (diff)
Added Spring Framework sample code
Diffstat (limited to 'spring-framework/04-basic-no-xml-java-configuration/README')
-rw-r--r--spring-framework/04-basic-no-xml-java-configuration/README12
1 files changed, 12 insertions, 0 deletions
diff --git a/spring-framework/04-basic-no-xml-java-configuration/README b/spring-framework/04-basic-no-xml-java-configuration/README
new file mode 100644
index 0000000..5e8720d
--- /dev/null
+++ b/spring-framework/04-basic-no-xml-java-configuration/README
@@ -0,0 +1,12 @@
+This project illustrates how a Java class can be made to describe the Spring configuration
+where the objects returned by methods in the class are made to be the Spring beans.
+
+The class is annotated with @Configuration which indicates that the primary purpose of the
+class is to act as a source of bean definitions.
+
+@Bean is used with a method to indicate that the method instantiates, configures, and
+initializes a new object to be managed by the Spring IoC container. It plays the same role
+as the <bean/> element.
+
+It is not necessary for the classes from which beans are instantiated to have annotations
+like @Component or @Autowired since the @Bean annotated methods perform the configuration.