Berocoder 14 Posted July 28 Wrote a blog today how to use interfaces to remove uses in a unit. https://berocoder.blogspot.com/.../how-to-remove... Code for project https://github.com/bero/InterFaceWithGUI 2 Share this post Link to post
zed 14 Posted July 29 (edited) Service locator (anti)-pattern? Edited July 29 by zed Share this post Link to post
Stefan Glienke 2002 Posted July 29 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
Brandon Staggs 277 Posted July 30 (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 July 30 by Brandon Staggs Share this post Link to post