raulraja
05/31/2019, 11:33 AMtmg
05/31/2019, 2:03 PM@Component
class MyService (repo: MyRepository)
@Repository
class MyRepository ()
Is just too easy. you can put configuration in arugments and spring will handle that.
Less things on main function. Spring boot is actually very nice to work with. I leave functional stuff for domain logic/rule/safety and consistency/integration.rulesDerek Berner
05/31/2019, 2:17 PMBob Glamm
05/31/2019, 2:34 PMDerek Berner
05/31/2019, 2:35 PMBob Glamm
05/31/2019, 2:37 PMDerek Berner
05/31/2019, 2:40 PMDerek Berner
05/31/2019, 2:41 PMkapt
anywaytmg
05/31/2019, 3:28 PMtmg
05/31/2019, 3:30 PM@Component
annotation, you do this:
val beans = beans {
bean<UserRepository>()
bean<UserHandler>()
}
Bob Glamm
05/31/2019, 3:34 PMfun <F> MonadError<F, Throwable>.runner(
logger: Logger,
s3: AmazonS3
): LoggingS3Ops<F> =
object: LoggingS3Ops<F>, MonadError<F, Throwable> by this {
override val LOG = logger
override val s3 = s3
}
Bob Glamm
05/31/2019, 3:34 PMDerek Berner
05/31/2019, 3:34 PMDerek Berner
05/31/2019, 3:35 PMDerek Berner
05/31/2019, 3:36 PMDerek Berner
05/31/2019, 3:37 PMDerek Berner
05/31/2019, 3:38 PMBob Glamm
05/31/2019, 3:41 PM@Transaction
is ... interestingBob Glamm
05/31/2019, 3:41 PMTransactable<F>
, I thinkBob Glamm
05/31/2019, 3:43 PMTransactableService<F>: Transactable<F>, Service<F>
Bob Glamm
05/31/2019, 3:48 PM@Transactional
anywayBob Glamm
05/31/2019, 3:49 PMTransactable<F>
every time that might be okBob Glamm
05/31/2019, 3:49 PMBob Glamm
05/31/2019, 3:49 PMraulraja
05/31/2019, 4:26 PMBob Glamm
05/31/2019, 4:30 PMBob Glamm
05/31/2019, 4:31 PMBob Glamm
05/31/2019, 4:31 PMraulraja
05/31/2019, 4:34 PMwith
. The compiler in addition to give you the instance places it in the this
scope so you don’t even need to prefix it to access its methods and properties.raulraja
05/31/2019, 4:35 PMraulraja
05/31/2019, 4:36 PM