title: CoreData: NSManagedObject extensions
body: <p>I'm using CoreData and I have two managed objects: Author and Book. An author can have may books, but a book can only have one author (for the sake of this example).</p>
  
  <p>The class Author extends NSManagedObject and Book extends NSManagedObject also. In my Author class, is it OK to create an extension, so that I can do custom searches within author. For example, would it be OK to write:</p>
  
  <pre><code>  Author* theAuthor = /* found somewhere else */
    NSArray* books = [theAuthor booksWrittenAfter:2009];
  </code></pre>
  
  <p>where the call to 'booksWrittenAfter:' would do the search in CoreData, returning books written after 2009 for that author?</p>
  
  <p>I have written this in code and it works and compiles, I was just wondering if this was OK to do, or whether all searches in CoreData should be done in another class and the classes Author and Book are kept simpler?</p>
  
  <p>Thank you very much!</p>
  
  <p>Michael</p>