Link to home
Start Free TrialLog in
Avatar of cofactor
cofactor

asked on

bean wiring in Spring framework

what is bean wiring in Spring framework ? Could you please explain a bit.

Any example please.
Avatar of StealthyDev
StealthyDev

Avatar of cofactor

ASKER

Buddy, I have read that already . But I don't understand the concept . Please explain
its written as ...

Combining together beans within the Spring container is known as bean wiring or wiring. When wiring beans, you should tell the container what beans are needed and how the container should use dependency injection to tie them together. '
How do we combine beans ?  I need example .  How do we do the bean wiring ?
See the below Example, you will be surprised!

http://www.javalobby.org/java/forums/t18396.html

Best Regards.
before that you must know the
singleton and prototype define of beans in spring ... this is the main concept here !

ASKER CERTIFIED SOLUTION
Avatar of Sathish David  Kumar N
Sathish David Kumar N
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>dispatcher-servlet xml
did you mean the Spring configuration file ?
^^ Yes the dispatcher-servlet.xml is none other than spring cfg file.

Wiring :

In traditional programming ,creating associations between objects lead to code that is difficult to reuse and unit-test, and these objects are usually highly coupled to each-other making them hard to reuse and unit test, and they are doing more work than they should making them less cohesive.In spring components are not responsible for managing associations with other components. Instead they are given references to collaborating components by the container. The act of creating these associations between applications is called wiring.
You got that?

Refer this if you still have any doubt :

http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-dependencies
yes your correct !!