Drac/ApiDesign

CLSWiki | Drac | RecentChanges | Preferences | Main Website

Some things that should appear on your APIs:

public const int LANCELOTS_FAVOURITE_COLOUR; (constant for the colour blue. This is an oldschool real programmer favourite.)

interface ICanTerminate?; (contains a shutdown() method for classes that can/should tidy up resources when they are done with)

boolean isHighlander(); (indicates that contray to data structure shape, is is valid for there to be only 1 of this particular object).

interface IHighlander; (implemented by classes that are expected to never die for the lifetime of the app - e.g. JMS listeners. Often extends ICanTerminate?, can have an isHighlander() method for singletons)

void JohnSheridan?(); (when called, terminates all threads in all processes in this application immediately (kills *))

Feel free to add.


CLSWiki | Drac | RecentChanges | Preferences | Main Website
This page is read-only | View other revisions
Last edited October 31, 2014 10:33 am by Pewterfish (diff)
Search: