-
Sep 4th, 2008, 11:14 AM
#1
How to decide which class will be Spring Bean
Hi,
I am new to Spring and I think I understood inversion of control , and I can understand simple projects (mostly related to the DAO). But when I need to decide which classes to be Spring Bean, the only ones that come in mind are
DAO classes (because of DataSource injection).
Can you please help me and explain how I decide which classes should be Spring Beans (in spring repository). Is there some heuristics about this?
Thank you very much,
Yanna
-
Sep 4th, 2008, 01:47 PM
#2
What kind of project are you building?
The beauty is that any object can be a spring bean. If you program towards interfaces, then you can nicely do the wiring of your objects using spring.
In a standalone app for instance, you only need to instantiate the spring context (ApplicationContext). From there spring instantiates all your dependencies.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules