Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor APCDataSubstrate and APCUser to make them modular #43

Open
p2 opened this issue May 11, 2015 · 2 comments
Open

Refactor APCDataSubstrate and APCUser to make them modular #43

p2 opened this issue May 11, 2015 · 2 comments

Comments

@p2
Copy link
Member

p2 commented May 11, 2015

As mentioned in #41, the data substrate and especially APCUser are tightly coupled to various parts of AppCore and the Bridge SDK. It would be nice to have these as protocols but keep the existing code as implementations of those protocols. Additionally, APCDataSubstrate (as-is) should take care of the stack initialization, not the app delegate.

@p2
Copy link
Member Author

p2 commented May 14, 2015

APCDataSubstrate

It seems it would make sense to create two protocols for the data substrate:

  • APCDataSubstrate <NSObject>
    • currentUser
    • parameters (mostly used for the bypass-server setting)
  • APCCoreDataSubstrate <APCDataSubstrate>
    • persistentContext
    • mainContext
    • persistentStoreCoordinator
    • -resetCoreData

APCUser

The user's interface could be converted into a protocol as-is. The current implementation could then be put into an actual class, maybe APCAppUser?
Its UserData category consists entirely of class methods, this could be put into a different class.

@jwe-apple As per your comment on #41, as a first step I'd leave the current APCUser implementation as-is to get this going. Then we can see if we want your object composition idea reflected in the protocol or just have the APC implementation follow that pattern. Hope this is okay.

I will start with this on a branch because I need it as protocols for our app.

p2 added a commit to chb/AppCore that referenced this issue May 14, 2015
@jwe-apple
Copy link
Member

Makes sense to me.

Erin-Mounts added a commit to Erin-Mounts/AppCore that referenced this issue Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants