2 @MASTER "Work:SC/XM/Autodocs/songclass.doc"
3 @REMARK This file was created by ADtoHT 2.1 on 08-Apr-97 12:17:15
5 @REMARK ADtoHT is © 1993-1995 Christian Stieber
7 @NODE MAIN "songclass.doc"
11 @{"background" LINK "background"}
15 @NODE "background" "songclass/background (information)"
19 songclass -- XModule 'boopsi'-oriented song implementation.
22 The song class is an object oriented way to handle a song. The song
23 class handles all data storing mechanisms for you and adds a layer
24 of abstraction between the song internal data structures and the
25 application. The advantage is that the internal structures can be
26 changed while keeping compatibility with existing software.
28 Another great advantage of being a 'boopsi' class is that the song
29 can notify other boopsi objects whenever its attributes change.
30 This simplifies the task of keeping the user interface updated each
31 time the user (or an ARexx macro, or whatever) changes something.
33 For speed reasons, the song class does also allow 'white box'
34 istance access. This means that you can also directly access
35 the internal data structures of the song, without using standard
36 boopsi methods. You are ONLY allowed to READ public fields, but not
37 to write any of them. The main reason to forbid direct writing is
38 that the song class must send notifications to its targets, but it
39 does also allow the song implementation to change in future version
40 without breaking existing applications.
42 When you create a new istance of the song class, the object handle
43 you get is actually a SongInfo structure. This is only possible
44 because the song class is a subclass of the rootclass, whose istance
45 is placed at a negative offset in the object handle.
46 Future song class implementations could require to be subclasses
47 of other classes, such as the gadget class or even the datatypes
48 class. This problem will be probably got around by keeping the
49 root class as the real superclass of the song and creating an
50 istance of the other superclass which will be passed all the
51 methods which are not recognized by the song its-self. Call this
52 boopsi polymorphism, if you like to :-)