title: AngularJS - Organizing large services & functions
body: <p>I honestly can't think of <strong><em>the one way</em></strong> when it comes to the organization of my services.</p>
  
  <p>I have a large service that defines a lot of methods, including one whose purpose it is to validate a large object. The functionality is quite complex, so I'd like to split the method up in bite-sized ones.</p>
  
  <p>How should I do that? I can think of multiple ways to achieve this:</p>
  
  <hr>
  
  <h3>Creating a helper service whose only purpose it is to provide validation functionality</h3>
  
  <p>This could be the most elegant way, however it would bloat my application with another service</p>
  
  <hr>
  
  <h3>Keeping it in the current service, just split up the methods</h3>
  
  <p>This would lead to a very large validation method that lives amongst other ones, creating a vast service:</p>
  
  <pre><code>app.service('serv',function(){
  
      return{
  
          someFunc: function(){
              // ...
          },
  
          // some more functions
  
          _validate: function(options){
  
              // call each function defined below
  
              function a(){
                  // ...
              }
  
               function b(){
                  // ...
              }
  
               function c(){
                  // ...
              }
          }
  
  });
  </code></pre>
  
  <hr>
  
  <h3>Defining private methods directly on the current service</h3>
  
  <p>Considering the above example, i could also define functions <em>a</em> - <em>c</em> directly on the service. Not quite elegant, too</p>
  
  <p>So what is the best practice here?</p>