Hot answers tagged

4

Static class methods are basically global functions, and are considered a bad idea in OO design. The reason why they are considered bad is hard to see in a simple code example where you are just comparing the difference between calling the same method on an instance or on the class itself. But when you get into slightly more complicated design global ...


3

Frameworks/SDK's probably use instantance methods because it makes dependency injection possible, which is not really the case for static methods. However, if you don't use DI, a static method is the simplest way. KISS.


3

Is concurrency and idempotency mutually exclusive for a REST web service or can it be done so a service can be both concurrent and idempotent? Yes, of course User A send same request, with Person.Version = 2 value. It fails because you expect the Person.Version value 3. I think you are confusing a couple different ideas. From Gregor Hohpe The ...


3

You need to watch this talk by Jim Webber. When I need to update the state of the subscription, I cannot simply send a POST request to the server, because I don't have direct access to the resources, but I need to call some RPC-style operations to update their properties. Additionally, only and only if I'm changing the state of the subscription to "...


2

From the documentation page you linked: Parameters since_id Returns results with an ID greater than (that is, more recent than) the specified ID. There are limits to the number of Tweets which can be accessed through the API. If the limit of Tweets has occured since the since_id, the since_id will be forced to the oldest ID available. Store ...


2

A chat service as a rest-ful api is a GOOD match ! I think resource-based interfaces are still a very important concept to talk about. The above answer is just not correct, even though it is over 4 years old. In general, really NOTHING is wrong about building a chat server interface as an resource oriented ReST-ful API. It is absolutely valid and a very ...


1

Don't get too caught up with the way things are usually done, an API can be restful without having to have resource identifier specified in the URL. In your case I would say its perfectly acceptable to place the path(s) in the POST body.


1

Can't you just set up an API path in your web app to track usage info? In my web app I have a path to start and stop session tracking for our lab's computers. The web app expects a username and creates a new tracking record. We have a simple script that runs on login - it gets the username of whoever is logged in and POSTS to /tracking/start. It works well, ...


1

I do like David Packer's answer on your other question. But to distill it a bit more: Some Business Logic on front end to reduce round trips. But all Business Logic on back end (which, yes, means you will have duplicated business logic) Also, forget about how difficult or not is to implement it on a language. You are taking an architectural decision ...



Only top voted, non community-wiki answers of a minimum length are eligible