This file contains hidden or 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
| interface Motor { | |
| val cilindrada: Long | |
| fun ligar() | |
| } | |
| class Motor1000 : Motor { | |
| override val cilindrada: Long = 1000L | |
This file contains hidden or 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
| class Carro { | |
| val motor: Motor | |
| init { | |
| motor = Motor1000() | |
| } | |
| } |
This file contains hidden or 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
| startKoin { | |
| modules(nossoPrimeiroModulo) | |
| } |
This file contains hidden or 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 nossoPrimeiroModulo = module { | |
| factory { PrimeiroComponente() } | |
| } |
This file contains hidden or 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 nossoPrimeiroModule = module { | |
| scope("Fluxo de cadastro") { | |
| scoped { ValidadorDeCampoVazio() } | |
| } | |
| } |
This file contains hidden or 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 nossoPrimeiroModulo = module { | |
| single { PrimeiroComponente() } | |
| } |
This file contains hidden or 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 nossoPrimeiroModule = module { | |
| // declaração dos componentes pertencentes ao módule | |
| } |
This file contains hidden or 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
| interface ClasseB { | |
| fun fazAlgumaCoisa() | |
| } | |
| class ClasseB1 : ClasseB { | |
| override fun fazAlgumaCoisa() { | |
| print("Eu sou classeB1") | |
| } | |
| } |
This file contains hidden or 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
| class ClasseA { | |
| private val classeB = ClasseB() | |
| ... | |
| } |