A Cocoa framework for object mapping to and from not-so-RESTful web services.
Connecting your app to a web server can be such a joy. Especially if that web server provides an API that was designed in cooperation with you and using the conventions of REST. Unfortunately this isn't always the case. Small design decision have big consequences for the implementation on the client side, leaving you with your super-RESTful framework that is a pain to connect to.
Spaghetti is a framework for connecting your app to a web server, but doesn't make too many assumptions on how RESTy that web server is. It consists of separate layers of abstraction that can be customized depending on the needs of the API. This makes it easy to connect to REST and less-than-horrible in other cases.
Clone this repo and take a look at the demo code.
+----------------+ +----------------+ +----------------+
Manage | Backend | | Schedule | | Operation |
+----------------+ +----------------+ +----------------+
+----------------+ +----------------+ +----------------+
Calling | Endpoint | | Call | | Dialogue |
+----------------+ +----------------+ +----------------+
+----------------+ +----------------+ +----------------+
Mapping | Mapping | | Path | | Transform |
+----------------+ +----------------+ +----------------+
+----------------+ +----------------+ +----------------+
Store | Store | | ObjectID | | ObjectType |
+----------------+ +----------------+ +----------------+
+----------------+ +----------------+
Utilities | Parser | | Path |
+----------------+ +----------------+
At top we have a set loosely related classes that provide high-level functionality to manage and schedule operations.
The connection layer deals with creation and configuration of calls over the line.
Mapping is the process of transforming data from a generic dictionary format to objects of custom classes.
The mapping and storing of data use a set of custom utilities that provide functionality not readily available in Apple's frameworks:
The source comes with an XCode project file that should take care of building the library and running the demo app. To use Spaghetti in your project, you can build a static Framework using the SpaghettiUniveral
target.
Documentation generated and installed by running from the project root:
appledoc -p Spaghetti -v 0.1 -c Noodlewerk --company-id com.noodlewerk -o . .
See the appledoc documentation for more info.
Spaghetti is licensed under the terms of the BSD 2-Clause License, see the included LICENSE file.