Codele / Advanced programming

Dependency injection

A lamp with a socket lets you swap the bulb. A lamp with the bulb welded in does not. Objects work the same way: hand them what they need instead of letting them build it.

Loading the playable lesson…