Where does PersistenceManager fit?

Chris's Avatar

Chris

03 Aug, 2012 05:18 AM

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.

  1. 2 Posted by Stray on 03 Aug, 2012 08:37 AM

    Stray's Avatar

    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

  2. Ondina D.F. closed this discussion on 25 Aug, 2012 02:42 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac