Should every single object have an interface and all objects loosely coupled?

It’s useful for objects which really provide a service – authentication, storage etc. For simple types which don’t have any further dependencies, and where there are never going to be any alternative implementations, I think it’s okay to use the concrete types.

If you go overboard with this kind of thing, you end up spending a lot of time mocking/stubbing everything in the world – which can often end up creating brittle tests.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)