We have an API description. We need to create
1) neccessary Business models (classes with properties and actions), which client application for this API should manage, i.e. we should have model?
User with properties login, password
2) server interacting part, which allows to make any request, listed in the API with given parameters, request should run asynchronous, providing progress and results to its delegate (ASIHTTPRequest as base should be used), i.e. we should have class UserAuthRequest, which can be called as?
[UserAuthRequest authUserWithLogin:login and password:password delegate:delegate]; - this will perform async HTTP request, recieve server answer, parse it and return answer to the delegate
3) Business server, which has methods, which parameters are business models, Business server is a Singletone class, which wraps model instance parameters, and performs neccessary requests to the server, i.e. it for authorization we can use
[BusinessServer authUser:(User*)user delegate:delegate];
4) All business models should also have necessary action selectors, i.e. User should have?
-(void)authWithDelegate:(id)delegate{
[BusinessServer authUser:user];
}
Most requests are simple Post requests or XML data request, and server always returns XML.
We already have library for handling such tasks. So all we need is for you to use our library as a base for creating this API interaction classes.
The result should be the following:
1) iPhone application, which performs all these requests, methioned in the API.
2) it should use our library to perform these request, so for each request you should create:
a) Subclass of Query class
b) Subclass of XmlAnswer class
c) Subclass of Result class
and also, you should create necessary business models and their actions and BusinessServer singleton.
## Deliverables
API and library project sources (which should link with your project) are attached.
Please, post a bid along with example of implementation of the Authorization mechanism - just to show, that you understand all requirements and able to implement rest of the interface.
From test project it is expected from you to create
1) User business model with necessary properties and authenticate action.
2) BusinessServer singleton with just one method?
+(void)authenticateUser:(User*)user delegate:(NSObject<ActionStatusDelegate>*)delegate; wich calls coresponding method of the ServerWork
3) ServerWork singleton with just one method
+(void)authenticateUserWithLogin:(NSString*)login password:(NSString*)password delegate:(NSObject<ActionStatuDelegate>*)delegate; which creates UserAuthenticateQuery instance, initializes its properties with corresponding values and performs it asynchronously.
4)? UserAuthenticateQuery - subclass of Query, this class should contain login and password properties, and should create required request body by overriding necessary superclass` selectors.
5) UserAuthenticateAnswer - subclass of XMLAnswer - base class for all server answer handlers, where server speaks xml. You should override necessary superclass methods to parse sever response (we need mostly userId returned by server or authentication error)
6) UserAuthenticateResult - subclass of the Result, should have just one read-only property for userId, which is transfered from answer. Something similar to
-(NSUInteger) userId{
return ((UserAuthenticateAnswer*)[login to view URL]).userId;
}
test project should contain code, which create User instance and perfroms its authentication.?
Feel free to contact me if you have any questions.