The conversation scope controller
The heart of our digital customer journey is a managed bean called LendingController
. We will break it down gently into easier sections as we go through this chapter.
The initial implementation looks like this:
package uk.co.xenonique.digital.instant.control; import uk.co.xenonique.digital.instant.boundary.ApplicantService; import uk.co.xenonique.digital.instant.entity.Address; import uk.co.xenonique.digital.instant.entity.Applicant; import uk.co.xenonique.digital.instant.entity.ContactDetail; import uk.co.xenonique.digital.instant.util.Utility; // imports elided @Named("lendingController") @ConversationScoped public class LendingController implements Serializable { @EJB ApplicantService applicantService; @Inject Conversation conversation; @Inject Utility utility; public final static int DEFAULT_LOAN_TERM = 24; public final static BigDecimal DEFAULT_LOAN_AMOUNT = new BigDecimal("7000"); public final static BigDecimal DEFAULT_LOAN_RATE = new BigDecimal...