Usage of spring-beans classes