2006/10/04

What's NeXT?

The next step to successfully use Web Services to substitute Cocoa EOF is to publish into a service an EOEditingContext. In this way, Core Data should be able to use EOF, via those services offered by the Editing Context, as a persistence media.

I am not quite sure where to put the line (the service); on top of the Editing Context? or, even below it?
To transfer Enterprise Objects? or, shall I transfer Dictionaries?... it will depend in the performance... we will see.

By the moment, the idea is to have, in the server side, the persistence mechanisms offered by EOF; and in the client side, a Cocoa app running Core Data to manage Display Groups and all the consistency necessary in a complex db-model. For, the model will have to be duplicated in the two formats: .eomodeld and .xcdatamodel ...

... welcome to a new nightmare!

Finally

It was much more easy than I thought...
following LeBer's advice, I went to the wikibooks and found that I better use the tool /Developer/Tools/WSMakeStubs.
It creates two objects (in my case Account.[hm] and WSGeneratedObject.[hm]) which I simply imported in a new project and, via some controller, they can invoke the service... I had to write the following two lines of code to see what was going on:

@implementation CPO
- (IBAction)servicio:(id)sender
{
id valor = [AccManagerService newAcc:[nombre stringValue]
in_who:[quien stringValue]];
NSRunAlertPanel(@"Servicio",
@"El valor es = %@",
nil,nil,nil,valor);
}
@end


Nice and beauty...