AeroGear iOS lib – Milestone 2

Today we, the AeroGear team at Red Hat, released the second version of our little iOS library, containing these new features:

  • configuration objects
  • query and search parameters
  • OTP (One-Time Password)
  • Model APIs and CoreData

What’s new in iOS?

Below the features are described in a few sentences.

configuration objects

After the first milestone release, one key point was making the API a bit nicer. Instead of having lot’s of (long) methods to provide several configuration options, we decided to use a configuration object that’s passed in to a block:

id projects = [pipeline pipe:^(id config) {
   [config name:@"projects"];
   [config type:@"REST"];
}];

As shown above, when creating a pipe, a configuration object is passed into the block function, where the App developer can specify the desired values for his pipe. This is also a nicer way, compared to using the builder “pattern”, which is more common in the Java world as described here.

query and search parameters

Further, initial work has been done to support quering and paging of the data. Currently implemented in the Pipeline using the readWithFilter method, will allow you to specify your query (where clause) and paging (limit/offset) requirements, which will then be passed on your remote endpoints to process. Work is in progess, to support quering and paging on the local DataStore, exploiting some of the fine mechanisms that the iOS provides (e.g. NSPredicate) and of course provide easier abstractions for our users to work with.

Quering and Paging is going to play an important role in the next couple of releases. Currently, there is an ongoing discussion in the mailing list, so if there is correct time to get involved it is now! We would be more than happy to hear your ideas and suggestions.

Model APIs and CoreData

The current AGPipe API is using collections for persisting and receiving “objects” (e.g. NSDictionary is used to represent the object state in a key/value fashion):

...
NSMutableDictionary* projectEntity = .....

// save the 'new' project:
[projects save:projectEntity success:myCallback failure:errorCallback];

The generic aspect of this means that your are pretty flexible in writing your own Model API layer. You could even use Github’s new Mantle Framework, like described here. We do have a demo app, using Mantle in our repository.

CoreData outlook
We started looking to support CoreData, but that will not happen over the above pipe API. The idea is to use the AFIncrementalStore to support the mapping of CoreData to HTTP, so that you can easily access our backend. The current plan is to have a subclass of UIManagedDocument, which uses a AFIncrementalStore instance for the HTTP/CoreData mapping. The benefit would be that iOS/CoreData developers can continue to use known and established APIs (e.g. ManagedObjectContext, NSFetchRequest, FetchRequestController etc). They would just use a different UIManagedDocument (sub)class.

OTP

My co-worker Christos Vasilakis (author of the famous JBoss Admin iOS app) wrote a detailed blog post how the AeroGear project is now support OTP on different platforms. Check it out!

We want feedback!

As always, if there are concerns or missing features, let us know! Join the mailing list for discussion, hangout on our #aerogear IRC channel or even file bugs! We are happy to hear your thoughts and feedback!

Have fun!

About these ads

Howdy!

Posted in aerogear

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 33 other followers

%d bloggers like this: