So I am thinking in rewriting an API that perform CRUD operations, or at least considering learning how to design an interface that can manage properly these operations. I understand it is not only about making proper GET/POST/PULL/UPDATE calls but there is also a “proper” design logic underneath. Am I right? Could you comment on what it takes to do a proper RESTful API? There are lots of documentation and discussions in the web. I am more interested in learning your opinion on this.
Thxs for your reply. It is too bad you are not doing the tutorial. The reason I am interested is bc of this post in the Processing forum.
I am not sure how long it will take me to figure it out. I will need to become familiar with the engine and to learn about proper restful concepts. I am definitely exploring your tutorials and doing them as time permits. I am still working in some shiffman series.
I think initially I would like to work on a client API. You see, I saw shiffman’s videos on accessing data using APIs and the concept was neat as well as his demos. However, I haven’t seen the same level of flexibility in the Processing side. I have to say I haven’t worked much with the API side in processing, and you see way less comments on API calls in the forum.
APIs is one of the things I want to add under my belt this summer…
On the server side, yes… I thought about a couple of ideas but nothing terrific. More like for demonstration and experimenting with concepts. I will start with your tutorial you have for now.
If you’re trying to use a rest api on the client / Processing side, then you don’t have to invent your own API on the server side. There are a ton of APIs already out there! Pretty much anything you can think of has an API, as do most websites like Spotify or Twitter.
Wow, thxs a lot! I’m probably the first one going thru your guide, no doubt. I am still buried in work for two projects and I haven’t been able to work on your material. But this guide is a must for me this weekend. Thanks a lot!
Wow, it will take me longer that the time I have left today to read through your material. So, I noticed this is in your advanced section. I decided to read first about your Servlet section to become more familiar with what it was coming ahead. I do not have server experience, but I have to say that using php is about the same but it doesn’t require to compile and generate jar files or to have an strict folder layout (Servlet section). Would servlet be any better than php in certain(any) situations?
I read your concept of REST API and it is a very common way to define it. I have seen it in many places and I think at the end it is require for the user to have some server experience to fully understand the concept. I say this from a pragmatic approach, which is my approach for most cases… yes, not the most efficient… However, I find your explanation better as you start your discussion with the difference between building code for a single web application vs. different type of clients that could request the information. Then, we just need to adhere to these rules. I don’t know if it is easy to stick to those rules or if you have to break them in case the design had some initial flaw, for example it is not easy to maintain or expand (for example, instead of having people/Adam to have westSchool/people/Adam).
Those are my thoughts for tonight… More to come tomorrow if I survive work… Thxs for doing this!
Languages are like tools. PHP is good for certain tasks, Java is good for others. Node.js is good in some contexts, and Ruby is good for others. Those are all languages that you can just on a server. I like to use Java because, well, that’s what I’m used to. That’s what I learned to program with, and it’s what I use at my day job. So it makes the most sense for me to stick with what I know. I chose to write a Java-based server tutorial because if you’re coming from the other tutorials on the site (starting with Processing and working your way up through Java), then sticking with Java makes sense.
Using westSchool/people/Adam instead of people/Adam is fine. That’s still a URL, so you’re still using a URL to represent your objects. A violation would be if, for example, you required the user to first submit a POST request to setPerson with data that contained Adam and then submit a GET request to getPerson to get Adam’s data. That means your requests are no longer standalone, which is a violation of REST principles.
Maybe a more likely scenario is handling logins: it’s pretty easy to use sessions to manage user logins, but using sessions is a violation of REST principles. So you have a decision: do you try to stick with a “pure” REST solution and require login information be passed with ever request, or do you go with a “REST lite” solution and keep using sessions?
There is no right answer to that question. Like I said in the tutorial, there are no REST police that will come kick your door down if you don’t obey every “rule” of REST. It’s completely up to you how strict you want to be.