Objective-C in the Cloud

Client Framework available

27 Jan 2014

Some of you might say: "It is about time guys!". We say: "Yupp."

To make a long story short: The client framework allows you to communicate with your cloud applications very easily saving your time. You don't have to know anything about NSURLConnection (et al.), serializing/deserializing and HTTP in general. The client framework takes care about that (and more). You simply send Objective-C messages like you are used to. But don't let the simple interface fool you: If you need more advanced features the client framework covers your back. If you are already sold you can jump directly to the client framework tutorial. By the way: In a few days we will add a conceptional guide that explains the framework itself in detail.

Easy Project Set-up

To use the client framework inside your project you simply link against the client framework.

Easy Connectivity

Four lines of code to build a local wrapper class for the service …:

// Subclass with messaging infrastructure
@interface Service : OCCService
@end

// Add service's API
@interface Service (CloudInterface) <ServiceCloudInterface>
@end

… and one message to connect it to the cloud application:

[Service linkToCloudApp:@"clienttutorial" protocol:@protocol(ServiceCloudInterface) handler:
^(__unsafe_unretained Class serviceClass, NSError *error)
{
  // Set-Up your app
}];

Things can be that easy.

Easy Invocation

You know Objective-C? Then you know Objective-Cloud. Messaging is straight forward:

NSString *response = [Service sayHello];

Easy Parallelism

Let easy things be easy and complex things be easy as well.

[OCCInvocationGroup executeBlock: //  Block is executed asynchronously
^(OCCInvocationContext *context)
{
  // Messages inside the block are blocking
  NSString *aminsGreetings = [Service sayHelloTo:@"Amin"];
  NSString *chrisGreetings = [Service sayHelloTo:@"Chris"];
}];

Easy Error Handling

Let's face reality: The client framework is using HTTP and HTTP requests can fail for multiple reasons. With the client framework this could not be handled any better: For blocking invocations you simply ask the result whether it is an error or not:

NSString *response = [Service sayHello];
if ([response isObjectiveCloudError)
  // Error handling

Asynchronous invocation groups are more complex. Error handling is less complex. The client framework automatically knows, when a message is sent inside an invocation group and adopts it's behavior: It nil's out responses and stops sending messages to the cloud. You can ask for errors wherever you want.

[OCCInvocationGroup executeBlock: //  Block is executed asynchronously
^(OCCInvocationContext *context)
{
  // Messages inside the block are blocking
  NSString *aminsGreetings = [Service sayHelloTo:@"Amin"];
  NSString *chrisGreetings = [Service sayHelloTo:@"Chris"];
  if ([context objectiveCloudError]!=nil)
    // Error handling  
}];

Done.

Feedback? Hate-mail? Questions? Drop us a line: team@objective-cloud.com