June 2018
Intermediate to advanced
408 pages
11h 23m
English
In this section, we will see some of the best practices for configuring a bean in Spring:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- Bean Configuration definition describe here --> <bean id="xxx" name="xxx" class=""/> </beans>
In the preceding example, we identified the bean using id or name. We should use id to pick the bean instead of name. Usually, it does neither increase readability nor benefit any performance but it's just an industry ...
Read now
Unlock full access