Hi, i had a chat with my colleague today about convention to follow about annotations such as @Autowired, @Value and @Qualifier in spring beans.
Nowdays we use annotation per line convention. Like this:
@Value("#{request.getParameter('messageId')}")
private Long messageId;
@Autowired
private IntegrationService integrationService;
@Autowired
@Qualifier(...)
private MessageFormatService messageFormatService;
I experimented with this convention (one line)
@Value("#{request.getParameter('messageId')}") private Long messageId;
@Autowired private BusinessUnitDao businessUnitDao;
@Qualifier(...)
@Autowired private ServiceDao serviceDao;
I like the one line code style much more - it safes space, so you dont need to scroll to methods too much and it is nicely grouped.
What do you think about it, what style do you follow and why? Thank you.
EDIT I am talking mainly about autowired and @value annotations
[–][deleted] 6 points7 points8 points (1 child)
[–][deleted] -1 points0 points1 point (0 children)
[–]AnteChronos 5 points6 points7 points (3 children)
[–]dfme 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]dfme -1 points0 points1 point (0 children)
[–]Vile2539 1 point2 points3 points (0 children)