Refactor RKTableController Inheritance Hierarchy #765

Closed
blakewatters opened this Issue May 24, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Owner

blakewatters commented May 24, 2012

The current hierarchy is crowded and doesn't provide clear singular responsibilities for each table controller. Split the classes into:

  • RKTableController (Abstract Superclass)
  • RKStaticTableController (Used for building static tables, uses RKTableSection and RKTableRow models)
  • RKNetworkTableController (A subclass of RKStaticTableController that layers on network loading)
  • RKFetchedResultsTableController (Provides a Core Data backed fetched results controller with network synchronization)

I'm planning to write something similar for SSCollectionView and SSCollectionViewController (http://sstoolk.it/), they have a similar interface to the UITableView counterparts. Ideally it would be great to have a reusable core, but RKTableController is pretty tied to UITableView*.

Owner

blakewatters commented May 25, 2012

Interesting, I had not seen the collection view. Once we have the UITableView house in order we can look at further extractions of common bits to support driving alternate interfaces.

@signalsandstuff signalsandstuff added a commit to signalsandstuff/RestKit that referenced this issue May 31, 2012

@signalsandstuff signalsandstuff Merge branch 'master' of git://github.com/RestKit/RestKit
* 'master' of git://github.com/RestKit/RestKit: (360 commits)
  Fix issue where grouping objects by section in RKTableController and loading an empty collection would fail to refresh table view.
  Fix type mismatch assertion in cases where JSON/XML payload contains a string value for an integer primary key. fixes #754
  Fix static analyzer warning
  Cleanups to and test coverage expansion of RKTableController API's. refs #765
  Update RKTestFactory to silence logging output during setup/tear down operations. closes #764
  Reworked table controller state into a bit mask to coalesce state change into a single observation. fixes #753
  Implemented support for type coercions in primaryKeyAttribute API's. closes #758
  Cancel current object loader when loading a table view
  Clean up inconsistencies with 'cancelled' and 'cancel' to match Cocoa (isCancelled)
  Ensure managed object connections are established across appropriate managed object contexts
  Add RKLog helper for displaying detailed key-value validation failure information. closes #750
  Bump version to 0.10.1
  Fix for RestKit#709 - [RKManagedObjectThreadSafeInvocation serializeManagedObjectsForArgument:withKeyPaths:] is not properly serializing managed objects
  Ensure creation of Application Data directory when initializing Managed Object Store. fixes #657
  Add tests verifying expected behavior for availability of RKRequest response property. closes #527
  Eliminate duplication of request method to string logic in [RKRequest HTTPMethod]
  Migrate RKResponse property from RKObjectLoader to RKRequest. refs #527
  Fix static analyzer issues
  Replace v0.9.4 references with 0.10.0
  Rework intermittently failing tests
  ...

Conflicts:
	Code/Network/RKRequest.m
6b46630

@smclelland smclelland pushed a commit to smclelland/RestKit that referenced this issue Jun 7, 2012

smclelland Merge branch 'master' of git://github.com/RestKit/RestKit
* 'master' of git://github.com/RestKit/RestKit: (109 commits)
  Fix issue where grouping objects by section in RKTableController and loading an empty collection would fail to refresh table view.
  Fix type mismatch assertion in cases where JSON/XML payload contains a string value for an integer primary key. fixes #754
  Fix static analyzer warning
  Cleanups to and test coverage expansion of RKTableController API's. refs #765
  Update RKTestFactory to silence logging output during setup/tear down operations. closes #764
  Reworked table controller state into a bit mask to coalesce state change into a single observation. fixes #753
  Implemented support for type coercions in primaryKeyAttribute API's. closes #758
  Cancel current object loader when loading a table view
  Clean up inconsistencies with 'cancelled' and 'cancel' to match Cocoa (isCancelled)
  Ensure managed object connections are established across appropriate managed object contexts
  Add RKLog helper for displaying detailed key-value validation failure information. closes #750
  Bump version to 0.10.1
  Fix for RestKit#709 - [RKManagedObjectThreadSafeInvocation serializeManagedObjectsForArgument:withKeyPaths:] is not properly serializing managed objects
  Ensure creation of Application Data directory when initializing Managed Object Store. fixes #657
  Add tests verifying expected behavior for availability of RKRequest response property. closes #527
  Eliminate duplication of request method to string logic in [RKRequest HTTPMethod]
  Migrate RKResponse property from RKObjectLoader to RKRequest. refs #527
  Fix static analyzer issues
  Replace v0.9.4 references with 0.10.0
  Rework intermittently failing tests
  ...

Conflicts:
	Code/Support/Parsers/JSON/RKJSONParserJSONKit.m
c126532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment