Jump to content
Berocoder

Remove uses with interface

Recommended Posts

Posted (edited)

Service locator (anti)-pattern?

Edited by zed

Share this post


Link to post
1 hour ago, zed said:

Service locator (anti)-pattern?

This and also a kind of limited approach given that the lifetime of all those UI elements is bound to the application lifetime and they are all singletons (meaning that you cannot have more than one instance of say ITestDlg)

Share this post


Link to post
Posted (edited)

I don't see how this specific approach is helpful for any scenario. Other than checking a box that says "decoupled," what actual advantage does this method offer? Your blog post doesn't help me understand why I would want to do things that way.

 

I use interfaces when it is appropriate to maintain loose coupling between different units, but you are always going to have to write some kind of factory or glue between the interface and the implementation. One needs to take care that the inevitable means of coupling doesn't needlessly obfuscate what's going on.

Edited by Brandon Staggs

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×