Question

I am looking something like DAO pattern in objective c, but I was unable to find anything in Google.

It seems like dao pattern is not used in objective c.

Which is the pattern used in objective c similar to dao pattern? So I can find more info on that.

No correct solution

OTHER TIPS

A DAO is just a pattern, so it isn't language specific. Granted, the convention when writing in some languages is to use the DAO term in class names, but that doesn't change the structure or purpose of those classes. As such, you can create DAO classes in any OO language and assign responsibility to them. Indeed, the underlying data storage is unimportant when creating your DAO objects as their purpose it to present an interface in terms of your data model objects. So, you can create DAO objects around Core Data / SQLite / NSUserDefaults / file based storage / ...

There are many places where the DAO pattern is present in Cocoa Touch frameworks.

If you are looking at an SQLite database, Cocoa Touch provides you with C wrapper. You can also use FMDB as a wrapper.

Best example is CoreData, that gives you an interface to the persistent storage. It makes available to you specific data operations and fetch requests, without exposing the details of the storage.

You might also be interested in MagicRecord, an active record pattern implementation for Objective-C.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top