Wiring it all up

It seems like we already have all the components our application will be using. Now we just need to wire things together and fire it up. We are using the cake design pattern for dependency injection; so, as you have already seen, we can create one component registry with everything we need:

package com.ivan.nikolov.scheduler.registryimport com.ivan.nikolov.scheduler.actors.{ActorFactory, ActorFactoryComponent}import com.ivan.nikolov.scheduler.config.app.AppConfigComponentimport com.ivan.nikolov.scheduler.dao._import com.ivan.nikolov.scheduler.io.IOServiceComponentimport com.ivan.nikolov.scheduler.services.JobConfigReaderServiceComponentobject ComponentRegistry extends AppConfigComponent   with IOServiceComponent   with JobConfigReaderServiceComponent ...

Get Scala Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.