Where does PersistenceManager fit?
I'm in the process of creating a mobile app and I need to persist some data. I'm planning to use local shared objects via PersistenceManager class and SQLite by extending IPersistenceManager (SQLPersistenceManager).
I'm trying to work out if PM is a service in it's own right of if I should wrap in a service? I guess I'm leaning towards wrapping it as a service as I need to extend Actor and implement IPersistanceManager. But I wanted to see if there's another approach.
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Stray on 03 Aug, 2012 08:37 AM
Hi Chris,
I'm definitely in favour of wrapping services in your own service - that's the 'best' approach that I know of (if you search around you'll find Shaun concurs, he answered a similar question last week).
As you say, it allows you to implement the eventDispatcher and your own interface. More importantly, it decouples you from that implementation, so that if it turns out that PersistenceManager has a bug, you can implement a layer that fixes it. It also isolates you from API changes - perhaps less likely in this case, but a general rule for 3rd party code is to keep it at arm's length.
hth,
Stray
Ondina D.F. closed this discussion on 25 Aug, 2012 02:42 PM.