I'm making a library/framework in iOS that incorporates instant messenger functionalities, using CoreData (plus MagicalRecord and Mogenerator) to store messages and conversations.
I have mainly two NSManagedObject classes: Message and Conversation. For example in Message I have some class methods to create entities (say [Message createMessage] and some instance methods to query the table (say [message getLatestMessages]).
My question is how much can be a good practice to expose publicly in my framework Message and Conversation (and all their public methods).
Should I take a different approach, like wrapping entities with other classes?
However database context will be always hidden to framework's user.
Do not wrap them, they are already abstracted out enough. Just expose them as they are just data objects.
You should have one point of entry to retrieve data and to save data. Some form of DataController that is exposed to the outside application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With