[CSF] OfficeFloor: Going Beyond Dependency Injection

So why another Dependency Injection (DI) framework? Because Dependency Injection is only part of the Inversion of (Coupling) Control problem. OfficeFloor provides the complete injection solution.

Dependency Injection Problem

Dependency Injection on it's own can actually promote lower cohesion and higher coupling. Why, because Dependency Injection provides undisciplined short cuts to get references to objects. I need a repository to retrieve some data, I just inject it. I need some logic to work out some result, I just inject it. Overtime with on going improvements to systems, everything starts to reference everything else. Changing the interface of one thing becomes difficult, as so many things just pull it in (higher coupling). Furthermore, because it is so easy to "just inject" dependencies, convenience starts polluting single purpose logic of classes (lower cohesion).

Inversion of Control (Explained Non-Technically)

I will use how businesses evolve to provide an analogy for Inversion of Control.

Businesses don't set out on day one to be a Fortune 500 company. Typically, they start with you in your garage (maybe with a friend).Over time, your business grows and you hire people, assign clearer functional responsibilities, and start to scale up your business. Businesses have to do this, while also changing quickly to stay competitive.

Functional Programming Is Just a Safety Restriction on Object Orientation

I find that functional languages are an admiration of it's own idealized self. Their pursuit of mathematical (lambda calculus) purity forgets that systems run in the real world and not in theory. Yes, for academia and advancing compilers, they are great where idealized theory is the endeavour. However, their idealism is neglectful of the limitations and realities of computing for commercial development. Why be shamed for wanting to allow side effects and mutating objects? Especially when functional programming just further restricts object orientation.

Limitations

To illustrate my point of limitations within computers, let's use the typical functional programming example of calculating a particular value for the Fibonacci sequence.