RSS Feed

Posts Tagged ‘Patterns’

  1. Implementing a Repository Pattern for iOS Apps

    August 31, 2010 by james

    Ever since I started working with iPhone and Core Data, ive been a bit taken back by how hap-hazardly the code ive seen is used for it.  People just set up entity retrieval and fetches wherever it is needed in the code and move on.   I believe i have an idea on how to fix this issue.

    (more…)


  2. Sqlite to Core Data: Update

    February 3, 2010 by james

    If you keep up with my blog, you’ll see ive been moving a project from SQLite to Core Data, here’s an update.

    So while ive been working on this, ive been running into a few issues, mainly getting the relations set up correct in the data models, but its been working very smoothly.  While re-working this, i thought to myself, i need to use the repository pattern in this.  As core data is still a bit new, there is still a little bit of textual writing while querying, and instead of having strings for this all over the place in various classes, ill just have them all in one class.

    Here’s some info on the repository pattern (using .NET as an example) here.

    In most of our recent projects, weve been using the repository pattern with our Linq-To-SQL classes, and its been very helpful in keeping code clean, with all of the querying in one spot.

    Im currently working on an example project in XCode that shows how to implement the repository pattern, while using protocols as well for some cool safecatches.

    Look for that towards monday or tuesday.