Skip to main content
replaced http://stackapps.com/ with https://stackapps.com/
Source Link

I am busy building an app using the API and I am about to start to work with the API.

I have looked at the one other PHP libraryPHP library, and it is one object with method calls which return back a ResponseCore object. (Not sure on the whole response core thing tbh, why not an array?)

I'm not overly sure that sits right with me, however looking at other library's the "one object with method calls" seems to be the way people are going. Or am I missing good example of a library?

Would a library that had a classes like these be of any interest? Or something like this..

StackApp
StackAppAnswer
StackAppBadge
StackAppComment
StackAppQuestion
StackAppTag
StackAppUser

Or a one class "StackApp" that returns back some arrays be enough?

I'm really looking for a good way of structuring a library, I don't need a full representation of the api for my app but if I am going to programme up one part of the API I would like to do it neatly and open source it so other people can help complete it.

I am busy building an app using the API and I am about to start to work with the API.

I have looked at the one other PHP library, and it is one object with method calls which return back a ResponseCore object. (Not sure on the whole response core thing tbh, why not an array?)

I'm not overly sure that sits right with me, however looking at other library's the "one object with method calls" seems to be the way people are going. Or am I missing good example of a library?

Would a library that had a classes like these be of any interest? Or something like this..

StackApp
StackAppAnswer
StackAppBadge
StackAppComment
StackAppQuestion
StackAppTag
StackAppUser

Or a one class "StackApp" that returns back some arrays be enough?

I'm really looking for a good way of structuring a library, I don't need a full representation of the api for my app but if I am going to programme up one part of the API I would like to do it neatly and open source it so other people can help complete it.

I am busy building an app using the API and I am about to start to work with the API.

I have looked at the one other PHP library, and it is one object with method calls which return back a ResponseCore object. (Not sure on the whole response core thing tbh, why not an array?)

I'm not overly sure that sits right with me, however looking at other library's the "one object with method calls" seems to be the way people are going. Or am I missing good example of a library?

Would a library that had a classes like these be of any interest? Or something like this..

StackApp
StackAppAnswer
StackAppBadge
StackAppComment
StackAppQuestion
StackAppTag
StackAppUser

Or a one class "StackApp" that returns back some arrays be enough?

I'm really looking for a good way of structuring a library, I don't need a full representation of the api for my app but if I am going to programme up one part of the API I would like to do it neatly and open source it so other people can help complete it.

edited tags
Link
Jeff Atwood
  • 960
  • 1
  • 12
  • 18
Source Link
johnwards
  • 465
  • 2
  • 8

Best way of structuring a library?

I am busy building an app using the API and I am about to start to work with the API.

I have looked at the one other PHP library, and it is one object with method calls which return back a ResponseCore object. (Not sure on the whole response core thing tbh, why not an array?)

I'm not overly sure that sits right with me, however looking at other library's the "one object with method calls" seems to be the way people are going. Or am I missing good example of a library?

Would a library that had a classes like these be of any interest? Or something like this..

StackApp
StackAppAnswer
StackAppBadge
StackAppComment
StackAppQuestion
StackAppTag
StackAppUser

Or a one class "StackApp" that returns back some arrays be enough?

I'm really looking for a good way of structuring a library, I don't need a full representation of the api for my app but if I am going to programme up one part of the API I would like to do it neatly and open source it so other people can help complete it.