Basically I meant what you said: the output should be available via URL (not requiring a POST or other method). There are two ways to a set up a URL for this. The traditional way has been to a query fragment, e.g.:
http://tgc.org/stars?type=unverified <- get all unverified stars
http://tgc.org/stars?type=verified&since=2014-10-30 12:00:00&distance=20&origin=Sol <- get all verified stars entered since 2014-10-30 12:00:00 within 20 Ly of Sol
It's also possible to make the query parameters part of the URL hierarchy, e.g.:
http://tgc.org/stars/unverified <- get all unverified stars
http://tgc.org/stars/verified/since/2014-10-30 12:00:00/location/Sol/20 <- get all verified stars entered since 2014-10-30 12:00:00 within 20 Ly of Sol
It's really an implementation detail. My main point is that the outputs should be available via a simple GET as this is more accessible and allows caching.
Caching:
First, there are two "kinds" of caching.
There is client side cashing (what your browser does), and then there is server side caching (A server can cache some data internally to prevent pulling it from the DB repeatedly)
The first saves bandwidth (and load times), the second saves processing time on the server (and can thus output data faster)
Caching makes sense if the data "never" changes (like the stylesheets and JavaScript files your browser downloads visiting a given page).
We are however making an app whose purpose it is to continually update (add to) it's data.
So I question the caching argument.
If I do a
http://tgc.com/systems - I expect to get data including the newest available, and not some cached version - that might be missing the last 10 entered systems.
Note here again the difference in caching.
The server is free to cache anything it likes (saving DB hits).
But the browser will (by design) not even bother asking the server, if the cache time has not expired (it will simply use a locally stored copy)
So I'm not totally happy about the idea of using GET, using caching as an argument.
Secondly, and this is a personal preference, I prefer POST (over GET) as it allows for structured query parameters.
Granted, currently the need for that really isn't there. But I prefer being prepared.
It would really suck if we suddenly had the need, and had to tell everyone to change their tools to use POST instead of GET.
Better everyone is using POST from the get go.
The downside with POST is of course that you cant just type in an URL and see the result in the browser.
But honestly who would want to see that output in a browser anyhow?
The purpose of the TGC is not to be and end-point for endusers - That's the job of the tools.
The job of the TGC is to be a depository of "canonical" information - That the tools can then use for whatever purposes they need, and present it in a way that makes sense in the context of the tool.
Which I suspect in most cases won't involve showing system coordinates (the main canonical data of the TGC) anyhow.
So the argument for using GET, of being able to just type it in a browser and thus see the data in the browser is moot imo as well.
There is even a (weak) argument for not allowing people to simply enter an URL and see the result in the browser.
It's too damn easy, and many will try it "just to see", which will mean more bandwidth used, and more work for the server.
I don't expect this would be much of a burden, percentage wise, but for completeness it bears mentioning.
--
"make the query parameters part of the URL hierarchy,"
This is usually referred to as a RESTful API.
I'll admit this is all the rave these days and considered "best practice" in many circles.
I'm not a super great fan though (again, personal preference) - As it requires to keep track of a great many URL endpoints, and (if you are sane) forces you to use a specific way of programming (MVC), as it naturally lends itself towards this type of URL creating/consumption (and makes it more natural to use/consume all these different URLs)
Basically I find it a bit "confusing" if you will. In it's simplicity (which is what it is all about) it makes other things more complicated.
I find it much simpler to keep track of a few request parameters - and using the same URL.
And it doesn't "force" me to program in a certain way. (and no it doesn't absolutely force me - But it makes my life more complicated if I don't "conform")
---
To summarize:
- I prefer POST over GET (I think there are valid arguments for this)
- I prefer not going with a REST API (This is purely a personal preference)
- - - - - Additional Content Posted / Auto Merge - - - - -
As for Sol in center or Sol in corner, no big deal.
Cool!
SOL will be present in all 4 boxes surrounding it.
Why would you do that?
It should only be present in one cube - Having it in more than one is in-consistent.
Basically cube 0,0,0 - contains the coordinates 0 <= x,y,z < 20 ly (note the "<=" vs "<") thus insuring no system is present in more than one cube.
------
EDIT: OK that auto-merge crap is getting really annoying...