Created
August 11, 2021 20:18
-
-
Save osama-raddad/58dbab0094f77cdbc8401b1494784dfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val namewarehouse = warehouse(Accessibility.LOCAL) { | |
this add module { | |
this add factory(contract = Name::class) { | |
this constructor { FirstName() } | |
this name "osa" | |
} | |
this add factory(contract = Name::class) { | |
this constructor { FirstName() } | |
this name "first" | |
this type Type.SINGLETON | |
} | |
this add factory(contract = Name::class) { | |
constructor { LastName() } | |
this name "last" | |
} | |
this add factory { | |
this constructor { FirstName() } | |
} | |
this add factory { | |
constructor { LastName() } | |
} | |
this add factory { | |
constructor { FullName(param(), param()) } | |
} | |
} | |
} | |
val userIDwarehouse = warehouse(Accessibility.Public) { | |
this add module { | |
this add factory { | |
this constructor { 12 } | |
this name "age" | |
} | |
} | |
} | |
val userwarehouse = warehouse(scope = Scope.CONSUMER) { | |
this add namewarehouse | |
this add userIDwarehouse | |
} | |
val consumerServiceLocator = warehouse(scope = Scope.CONSUMER) { | |
this add userwarehouse | |
this add module { | |
this add factory { | |
constructor { Access.ADMIN } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment