Application Programming Interface (API) Design discusses best practises for creating libraries intended for general purpose or public use.
-1
votes
1answer
38 views
Naming a predicate: “precondition” or “precondition_is_met”?
In my web app framework, each page can have a precondition that needs to be satisfied before it can be displayed to the user. For example, if user 1 and user 2 are playing a back-and-forth ...
8
votes
2answers
319 views
Is implementing an interface defined in a subpackage an anti-pattern?
Let's say I have the following:
package me.my.pkg;
public interface Something {
/* ... couple of methods go here ... */
}
and:
package me.my;
import me.my.pkg.Something;
public class SomeClass ...
2
votes
1answer
88 views
Using Dynamic LINQ to get a filter for my Web API
We are considering using the Dynamic.CS linq-sample included in the "Samples" directory of visual studio 2008 for our WebAPI project to allow clients to query our data.
The interface would be ...
2
votes
3answers
430 views
Chain-of-Command/Responsibility pattern for my simple API. A good idea?
I need to write a simple API for a project I'm working on. This API will be used internally to perform some server side actions that were triggered by AJAX calls.
To make things easier for me, I ...
0
votes
0answers
56 views
Merge two different API calls into One
I have two different apps in my django project. One is "comment" and an other one is "files". A comment might save some file attached to it.
The current way of creating a comment with attachments is ...
20
votes
10answers
849 views
API design: concrete vs. abstract approach - best practices?
When discussing APIs between systems (on the business level) there are often two different point of views in our team: some people prefer a more - lets say - generic abstract approach, other a ...
2
votes
1answer
64 views
API Caching Layer
Primer: We have a mobile app being served by an API (written in PHP). The main point of the app is to display products from a large items table in the database, in a multitude of different ...
2
votes
1answer
108 views
What are the guidelines for either throwing an exception or failing silently for nonvalid arguments? [duplicate]
If you look at XContainer.Add(object content) method you can see that id does not require content to be not null. It just does nothing in case of null.
However List.AddRange(IEnumerable collection) ...
1
vote
0answers
70 views
Returning view code in an API response
I have an API that returns a JSON formatted array of users within a given pair of lat/ long bounds.
I'm using this data to plot a number of markers on a map, based on the location of each user.
I ...
1
vote
2answers
157 views
In my permissions API, how do I handle objects that don't exist?
Elgg is designing a permissions API loosely around the Activity Streams model. The user API could look (roughly) like:
function elgg_can($capability, $subject = null, $object = null, $target = null) ...
2
votes
2answers
132 views
Should an Http API always return a body?
Is there some sort of standard regarding http api responses?
After reading this discourse thread I started to wonder. We are developing our public http json api at my work, and we do not return ...
3
votes
3answers
623 views
API Development - Sinatra?
I've been tasked to create a mobile application as well as an accompanying website. Both the application and website will interact with the same database. To make things easy, I figure creating an API ...
3
votes
2answers
241 views
Is a data service API a good idea?
We currently have a monolithic Rails application that is really three separate applications that make use of the same data. In trying to figure out how to properly compartmentalize and break the ...
0
votes
1answer
79 views
Best practices for deploying multilingual API
I have a hobby project and it looks like there is need to have some API library (which in turn is a wrapper over existing http API) at least for two languages - JavaScript and Python, adding support ...
3
votes
3answers
353 views
Is it OK to return HTML from a JSON API?
On my current project I am responsible for the implementation of a service which involves the consumption of newly created RESTful APIs, documented as solely supporting JSON.
The client consistently ...