<XML><RECORDS><RECORD><REFERENCE_TYPE>10</REFERENCE_TYPE><REFNUM>9376</REFNUM><AUTHORS><AUTHOR>McGinniss,I.</AUTHOR><AUTHOR>Gay,S.J.</AUTHOR></AUTHORS><YEAR>2011</YEAR><TITLE>Hanoi: A Typestate DSL for Java</TITLE><PLACE_PUBLISHED>DCS Technical Report Series</PLACE_PUBLISHED><PUBLISHER>Dept of Computing Science, University of Glasgow</PUBLISHER><PAGES>20</PAGES><ISBN>TR-2011-326</ISBN><LABEL>McGinniss:2011:9376</LABEL><KEYWORDS><KEYWORD>typestate</KEYWORD></KEYWORDS<ABSTRACT>Many APIs contain interfaces in which methods have strict state based preconditions, while mainstream programming languages provide no facility to express these constraints in a concise, human readable, machine verifiable form. Failure to detect violations of these preconditions can result in partial or catastrophic failure of a system, therefore programmers must take great care in understanding and verifying the usage of such APIs. We present a domain specific language, Hanoi, which can be used to express state restrictions in APIs. By classifying Hanoi and existing typestate languages and highlighting their differences, we show Hanoi can be more concise and potentially easier to understand than existing approaches. We also present a simple dynamic checking system which uses Hanoi models to verify interface usage, alleviating the burden on the implementer of such interfaces to defend against incorrect usage.</ABSTRACT><URL>http://www.iainmcgin.co.uk/papers/TR-2011-326.pdf</URL></RECORD></RECORDS></XML>