Application Programming Interface (API) Design discusses best practises for creating libraries intended for general purpose or public use.

learn more… | top users | synonyms

3
votes
3answers
400 views

API method placement guidelines?

Are there any guidelines for placing methods in API when the placement isn't obvious? Example: I have classes A and B and a method X. The work being carried out can be phrased in two ways: A does X ...
3
votes
7answers
364 views

Better name for existsByUserNameAndPassword()

I wonder if there is a better name for a DB API function called existsByUserNameAndPassword() which returns boolean. There are more function called like this: existsByOldId()... It sounds a little bit ...
7
votes
5answers
5k views

How best do you represent a bi-directional sync in a REST api?

Assuming a system where there's a Web Application with a resource, and a reference to a remote application with another similar resource, how do you represent a bi-directional sync action which ...
5
votes
1answer
757 views

Sending a collection of data to an API. Multiple small calls vs one big call

I am currently creating an API and implemented a few basic REST actions such as get, update, search etc. Another program that collects data needs to synchronize these to this API. My current thought ...
3
votes
1answer
121 views

How should I deal with external data sinks?

I recently took on a contract job that will largely involve generating data feeds from my client's data and sending it to external partners, via feeds and API invocations. I've always found this ...
2
votes
2answers
98 views

How should XML subtree manipulation be handled in a public API?

I'm working on an API whereby a specific call would replace a subtree of an XML document—rooted at some element—with another subtree. The two options I'm considering for a response to this call are: ...
5
votes
3answers
323 views

Should I provide synonyms in an API?

I'm designing a small library and there is a strong temptation to provide synonyms to some of the exported functions. var foldl = function(){ ... }; var reduce = foldl; //reduce is a synonym for ...
4
votes
1answer
743 views

Mask oAuth API key and token for pure client-side technologies

If I were to build a Twitter or Facebook application using pure client-side technologies like HTML and javascript, how would I mask/hide my API keys? For example, for Twitter I have consumer key and ...
4
votes
3answers
252 views

Creating a webservice API - how much “credit” should I give the client/developer

When creating a web service API, how much should I count on the developer to act by my rules? We are really aimed on creating an API so the developers shouldn't develop client side logic too much... ...
2
votes
3answers
448 views

Creating public API definition for existing application

Let's say there's a successful open source application (written in PHP if it matters), which provides its users with multiple ways to extend it (think about something like Drupal or Wordpress, lots of ...
3
votes
3answers
711 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 ...
1
vote
1answer
169 views

How do you deal with errors in enumeration / list processing (lowish-level API)

Ive struggled with variants of this problem many times, experimenting with different solutions, happy with none. Abstract: Enumerating a list of items, an error for one item does not affect the ...
-1
votes
3answers
1k views

API design pitfalls in C

What are some flaws that drive you nuts in C APIs (including standard libraries, third party libraries, and headers inside of a project) ? The goal is to identify API design pitfalls in C, so people ...
1
vote
4answers
218 views

API naming and namespacing

Is it right or more beautiful to name the functions with an prefix, like in Qt? Or using "many" namespaces, but 'normal' names for functions? For example, slOpenFile(); //"sl" means "some lib" vs ...
3
votes
1answer
172 views

What are some good Photo and Artwork APIs?

We had an idea for starting a ecards service and were looking into the possibility of populating our site using photo/artwork APIs. Due to legal reasons, Flikr probably won't work, although I've ...
5
votes
7answers
390 views

Why do certain code elements (classes, methods etc.) in public APIs get deprecated over time?

Today our professor discussed with the class that what "class X or method X get deprecated" means? From what I understood, it means, for example, that we are not going to get that method or class in ...
14
votes
7answers
2k views

Why does the Java collections APIs not have a last method?

This is for ordered collections e.g. java.util.List. Why did the language designers not include a last method? The only reasons I can think of are: ambiguity when the collection is empty (return ...
3
votes
2answers
410 views

Strategy for designing a plugin API

I am working on an application for which a rich plugin API is crucial. What is the best process for creating an API that is intuitive and easy to learn?
16
votes
4answers
434 views

Database abstraction — is it being overdone?

After being exposed to numerous database abstraction layers, I'm starting to wonder what the point is of every library inventing their own different paradigm to access data. Picking up a new DAL feels ...
5
votes
1answer
490 views

Application internal API

I am currently building a small python CLI (Command Line Interface) application with ambition. In the first development phase I would concentrate on making it work through the CLI interface only, but ...
13
votes
3answers
6k views

Is there a list of common usernames to reserve in a new system?

I need to reserve usernames in my new website. These generally fall into three categories 1) usernames no-one should have (eg: admin, user, service, help, root, etc) 2) names of super famous people ...
3
votes
5answers
183 views

Consistency vs. Usability?

When designing an API, consistency often aids usability. However, sometimes they conflict where an extra API feature can be added to streamline a common case. It seems like there's somewhat of a ...