tschneidereit / SwiftSuspenders

NOTE: Find the offical repo at http://github.com/robotlegs/swiftsuspenders
https://github.com/robotlegs/swiftsuspenders
MIT License
280 stars 89 forks source link

No issue , is suggest #93

Closed ganyanchuan1989 closed 9 years ago

ganyanchuan1989 commented 9 years ago

First of all thanks to the open source.I think SwiftSupender interface should add IXXX. For example: Reflector can be written as IReflector

tschneidereit commented 9 years ago

Hey @ganxunzou, thanks for your kind words. The issue of whether to use an I prefix or not has been discussed rather extensively in the past. I won't rehash the entire argument here, but the gist is that, especially if you use a dependency injection system like Swiftsuspenders, it should almost never make a difference whether you deal with an interface or a class. Calling out interfaces as such will only cause you to think differently about them when in fact you shouldn't. In the concrete case of Rflector, you should have exactly one place where you have to care about the fact that it's an interface: when you instantiate the single instance you'll need in your entire application. Everywhere else, you shouldn't need to know if it's an interface or not.

In any case, I'm not actively working on Swiftsuspenders anymore. If you want, you could propose this change for the Robotlegs fork of the project, where it now officially lives. However, I'd recommend first making sure you understand the arguments for and against using an I prefix.