'. '

Usecase

From APIDesign

Jump to: navigation, search

High level description of an actual problem a user (of an API) may face. For example:

I want to alphabetically sort names of some persons

Such usecase is then states that this is a problem that this API is ready to solve and is then followed by a scenario how to solve the given problem. For example:

Create a List of Strings. Put there the names. Use sort method.

Which is then reflected by the actual realization. In Java:

List<String> arr = new ArrayList<String>();
arr.add("Tom");
arr.add("Petr");
Collections.sort(arr);

Usecase are an important entry point when describing and documenting API abstractions. Always put usecases into overview section of Javadoc of your API.

Personal tools
buy