May 2018
Intermediate to advanced
310 pages
6h 18m
English
The most important mechanism responsible for achieving loose coupling is the IoC. What does this mean? Dependent objects give their own dependencies instead of creating or looking for dependent objects. IoC is a technique in which object coupling is bound at runtime by assembler that performs object coupling. Both IoC and dependency injection patterns are mechanisms responsible for removing dependencies from your code base.
Let's provide some examples to illustrate this. Imagine an application that has a music player and you need to provide it with a volume control mechanism. We will start with this:
class VolumeControl
class MusicPlayer {
val volumeControl = VolumeControl()
}
Now, let's do the IoC on it:
abstract ...
Read now
Unlock full access