Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.17 KB | None | 0 0
  1. builders := []Builder{
  2.     NewBuilder(controllerName, func(provider Provider) (interface{}, error) {
  3.         appService := provider.Get(appServiceName).(appService)
  4.         return (controller)(&controllerImpl{appService: appService}), nil
  5.     }),
  6.     NewBuilder(appServiceName, func(provider Provider) (interface{}, error) {
  7.         domainService := provider.Get(domainServiceName).(domainService)
  8.         return (appService)(&appServiceImpl{domainService: domainService}), nil
  9.     }),
  10.     NewBuilder(domainServiceName, func(provider Provider) (interface{}, error) {
  11.         domainObjectA := provider.Get(domainObjectAName).(domainObjectA)
  12.         domainObjectB := provider.Get(domainObjectBName).(domainObjectB)
  13.         return (domainService)(&domainServiceImpl{domainObjectA: domainObjectA, domainObjectB: domainObjectB}), nil
  14.     }),
  15.     NewBuilder(domainObjectAName, func(Provider) (interface{}, error) {
  16.         return (domainObjectA)(&domainObjectAImpl{}), nil
  17.     }),
  18.     NewBuilder(domainObjectBName, func(Provider) (interface{}, error) {
  19.         return (domainObjectB)(&domainObjectBImpl{}), nil
  20.     }),
  21. }
  22.  
  23. root := Assemble(builders, controllerName).(controller)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement