<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 13, 2016, at 5:24 PM, Talin via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">As a former Googler, I've spent a lot of years writing Java code that uses dependency injection, and this relies heavily on the ability to have custom annotations/attributes in the language - particularly, user-defined attributes on function parameters - and to generate additional code at compile time via annotation processors. Although dependency injection does have it's detractors, it's getting better (current best of breed is <a href="http://google.github.io/dagger/" class="">http://google.github.io/dagger/</a>), and it solves an amazing array of problems, including the ability for asynchronous programming to disappear into the underlying framework - you just write synchronous code and the framework handles the rest (no more futures!).<div class=""><br class=""></div><div class="">Now, you can of course do dependency injection without custom attribute support in the language, but it's much more cumbersome. The user-defined attributes allow you to specify, in a simple declarative way, the runtime dependencies between various classes. Without it you have to build up those dependencies in code, using some sort of fluent interface or builder pattern.</div><div class=""><br class=""></div><div class="">So my question is, is there any plan for Swift to support user-created annotations, and annotation processing compilation stages?</div></div></div></blockquote><br class=""></div><div>Hi Talin, </div><div><br class=""></div><div>We have no concrete plans for user defined attributes, but it is a natural extension. One of our goals for Swift 3 is to nail down the reflection metadata representation. We should design this to be extensible to support user defined attributes so that we don’t close this off in the future.</div><div><br class=""></div><div>-Chris</div><br class=""></body></html>