You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 4, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 4, 2026. It is now read-only.
Refactor APCDataSubstrate and APCUser to make them modular #43
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.
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.
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.