title: Is it recommended to store constant String in "extension String"
body: <p>I'm implementing an <code>Alamofire Router</code>. And I want to manage my constant url for each api. Normally I create a <code>struct</code> to store them like the following code:</p>
  
  <pre><code>private struct API {
      static let foo = "domain/models/foo"
      static let bar = "doamin/models/bar"
  }
  </code></pre>
  
  <p>But recently I found it also could be implemented in <code>String</code> extension, like</p>
  
  <pre><code>private extension String {
      static let foo = "domain/models/foo"
      static let bar = "doamin/models/bar"
  }
  </code></pre>
  
  <p>In this way, it's easier to me to use it. like</p>
  
  <pre><code>// from
  let urlFromStruct: String = API.foo
  
  // to
  let urlFromExtension: String = .foo
  </code></pre>
  
  <p>Because extending <code>String</code> means the constants become String's static properties. If I don't omit the <code>String</code>, the code would become</p>
  
  <pre><code>let urlFromExtension: String = String.foo
  </code></pre>
  
  <p>and to prevent these constant will be accessed in other files. I declare the extension with private.</p>
  
  <p><strong>So I wonder is it recommended to implement it by the <code>extension</code> way? or any other suggestion is appreciated.</strong> </p>