A pattern-based approach to generate code from API usage scenarios
Johannes Koskinen, Anna Ruokonen, Tarja Systä · Nordic journal of computing · 2006
The usage of an API of a software system requires learning and knowledge about the API itself. In tutorials, an API usage is typically described by giving a couple of example applications and some example code fragments. While such examples are useful and illustrative for the application developer, it is often difficult for her to separate application-specific parts from the API-specific ones, and further to distinguish optional and mandatory parts. In this paper we discuss an approach and tool support for guiding the application developer in API usage in a step-by-step fashion. As the examples are often sequential by their nature, we use UML sequence diagrams to describe possible API usage scenarios. We propose pattern-based tool support to exploit such sequence diagrams and to generate the application code in a semi-automated way.