My problem is that I'm dealing with a RESTful API that returns information about objects, and when writing classes to represent them, I'm not sure how best to handle all the accessibility status features of each variable. From what I can say, there are 5 possibilities: information
Thus, with this, if an object represents its data with a value or null, this does not shorten it. To give a more concrete example, I am working with the Congress API, so the problem is this:
I request account information and it contains a clause on the sponsor legislator. Ultimately, I need to request all the information about this legislator. Not all legislators will have all the information. Those in the House of Representatives will not have a Senate class (the six-year terms of the senators will be shaken, so that a third term expires every two years, the House is completely re-elected every two years). Some will not have a Twitter ID, simply because they don’t have one. And of course, if I have already requested information, I should not try to request it again.
There are several options that I see:
Legislator , , . , , .
, "" , , , , , .
, , . (?) ? ? , ?
[. Objective-C, .]
, REST. . , HTTP RPC , RPC.
, REST, , REST "State Transfer", HATEOAS. , . , , .
, "REST API" , , REST - .
, , , , .
-, , ; , , . , , . ; - , / . "" . , , ; , , - .
, , ; , ? , , - , . REST; , ; , , - .
-, . , , . , . , , ; , , . ; ( - , ), ( - , , , , ).
, , , RESTful ; , , URI ; . , , , , , ; , , (.. ). , , , REST .