Closed GoogleCodeExporter closed 8 years ago
the thing is that for JSON/XML it should only return XML or JSON. But for Jaxb
that
does some object construction, it's return type should be more appropriate to
the
method call..
So I might actually split the jaxb library into it's own api so that the method
can
have more appropriate return types. but that won't happen any time very soon..
Original comment by fern...@gmail.com
on 30 Sep 2008 at 2:15
I think that if we declare the type (List<Long>) then we defeat the purpose of
having
a flexible interface. Some people will still want to retrieve the response in
the
format of the client (jaxb vs xml, etc). I think it's important to keep the
response
in the format of the chosen client since many people will be using an XML
utility or
JSON utility or JAXB utility to parse responses. However with that said, I do
see
your point, the current approach does add extra complexity to what should be a
simple
response - a list of ids.
Original comment by hahna...@gmail.com
on 8 Oct 2008 at 3:18
With the JAXB version, you get a FriendsGetRequest object then can call
getUid() to
get a pre-parsed List<Long>.
That's fair enough, and when I raised this issue, I didn't properly understand
the
strategy for JAXB vs. JSON vs. XML.
However, I do like the "asList()" method strategy. It means that no matter which
IFacebookRestClient implementation you choose, you can get hold of Java objects
if
you want to (rather than XML or JSON). I guess it adds complexity to be able to
pick
and choose like that, but it would be good to have one object that holds the
state
and deals with communication with the facebook API and another object which
deals
with the conversion into a suitable type (XML, Java objects)... That way, you
could
have 2 conversion objects looking at the same Facebook Client object and get
some
data as XML, some as JSON and some as Java Objects.
Original comment by david.j....@googlemail.com
on 8 Oct 2008 at 8:16
Request that this issue as it stands be closed. (apologies, I don't have
permission).
Original comment by david.j....@googlemail.com
on 8 Oct 2008 at 8:17
thanx. we'll close this for now, since you do have an option.
I will try to file away the idea of separating concerns a little bit better
between
initiating requests to facebook, and parsing and dealing with those requests on
the
way back.. there might be a way to give people easy options.. :)
Original comment by fern...@gmail.com
on 8 Oct 2008 at 3:12
Original issue reported on code.google.com by
david.j....@googlemail.com
on 25 Sep 2008 at 8:25