O'Reilly logo

Scala Functional Programming Patterns by Atul S. Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dependencies injection pattern

The Hollywood principle (https://en.wikipedia.org/wiki/Hollywood_principle) is stated as "don't call us, we'll call you". One might hear this response after auditioning for a role in a movie. It won't work if the candidates call the recruiting agency every day. The agency would get swamped with calls if there were many candidates.

Instead, the agency will call back if they find someone suitable and want to take it forward.

This Inversion Of Control (IoC) applies to software designs too. IoC is different from other more traditional forms of programming.

Refer to https://techbizcurry.wordpress.com/2014/04/07/hollywood-principle-inversion-of-control-design-pattern/ for an excellent explanation.

Here is a real-world scenario. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required