VictorPavfurious commented on code in PR #4353:
URL: https://github.com/apache/fineract/pull/4353#discussion_r1969468791
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignReadPlatformServiceImpl.java:
##########
@@ -52,28 +54,22 @@
import org.springframework.stereotype.Service;
@Service
+@RequiredArgsConstructor
public class SmsCampaignReadPlatformServiceImpl implements
SmsCampaignReadPlatformService {
- private final BusinessRuleMapper businessRuleMapper;
private final JdbcTemplate jdbcTemplate;
private final DatabaseSpecificSQLGenerator sqlGenerator;
private final SmsCampaignDropdownReadPlatformService
smsCampaignDropdownReadPlatformService;
- private final SmsCampaignMapper smsCampaignMapper;
private final CalendarDropdownReadPlatformService
calendarDropdownReadPlatformService;
private final PaginationHelper paginationHelper;
+ private final SqlValidator sqlValidator;
+ private BusinessRuleMapper businessRuleMapper;
+ private SmsCampaignMapper smsCampaignMapper;
- @Autowired
- public SmsCampaignReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
- SmsCampaignDropdownReadPlatformService
smsCampaignDropdownReadPlatformService,
- final CalendarDropdownReadPlatformService
calendarDropdownReadPlatformService, DatabaseSpecificSQLGenerator sqlGenerator,
- PaginationHelper paginationHelper) {
- this.jdbcTemplate = jdbcTemplate;
- this.sqlGenerator = sqlGenerator;
+ @PostConstruct
+ public void init() {
this.businessRuleMapper = new BusinessRuleMapper(sqlGenerator);
Review Comment:
Do you mean that ?
private final SmsCampaignMapper smsCampaignMapper = new SmsCampaignMapper();
private final BusinessRuleMapper this.businessRuleMapper = new
BusinessRuleMapper(sqlGenerator);
I think yes, but i'd want to avoid NPE (on sqlGenerator) and make
architecture more clear and testability with using DI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]