loadLibraryData( );

vars
	libr		: PubLibrary;		ad 		: Address;
	bk 		: Book;						bwh 	: BookWeHold;	emp	: Employee;
	mbr	: Member;				adr		: Address;				dep 	: Department;
	bfs		: BookForSale;	bSell	: BookSeller;
			
begin
	beginTransaction;		 
	purgeOldObjects;   // Update this as you create instances of new classes
	//----------------------------------------------------------------------------
				/* In this update we shall assume no errors in the data so we have shown
				    no edit<X> method calls !  This is soooo  reckless !  */

	create ad;									// an Address for the Library
		ad.loadAddress ("PO Box 10408", "Park Central", "Jadesville","344-4455", "4567");
	create	libr;									// a Library
		libr.loadPubLibrary ( 0, "Bookish", "Head Librarian", "Mrs",  "F",  
													"30-12-2013".Date, ad, "Jadesville Public Library"  );
		//-------------------------------------------------------------------------------------
	create ad;									// an Address for BookSeller
		ad.loadAddress ( "PO Box 22345","Avonlea", "Gotham City","344-4455", "4567");
	create bSell;								// a BookSeller
		bSell.loadBookSeller (libr, 
													   "Bindwell", "Manager",  "Ms", "F", 
														"31-3-2013".Date,  ad,	"Windsor Earth Press");  
		//-------------------------------------------------------------------------------------
	create bk;									// a Book
		bk.loadBook ("Humus, Serena", "Gardening", "4th", "5 4564 1109 3", bSell, null, null, "Compost in all its glory" );
		//-------------------------------------------------------------------------------------
	create bwh;									// a BookWeHold
		bwh.loadBookWeHold ("2311", null, null, false, bk, null, libr, 0 );  
		
	bk.myBookWeHold	:= bwh;	// Now we can tell bk who its myBookWeHold is.)
		//-------------------------------------------------------------------------------------
	create dep;
		dep.loadDepartment (libr, null, "Administration");  // manager not known yet
		//-------------------------------------------------------------------------------------
	create ad;										//  Address data for an Employee
		ad.loadAddress ("Bahaii Hostel", "193 Works Rd", "Lower Jadesville", "021 34 008",
						  "4873");
	create emp;
		emp.loadEmployee ("BO1233", "Head Librarian", null, dep, libr, 37.20, 
												   "Hilda",  "Hilda", "Mrs", "F", 
													"31-8-2013".Date, ad,  "Bookish");
		
		dep.myManager := emp;// Now we can tell the Department who is its manager
		//-------------------------------------------------------------------------------------
	create ad;									//  Address data for a Member
		ad.loadAddress ("PO Box 20-210", "Central PO", "Antalya", "022 450 2398", "5537");
	create mbr;
		mbr.loadMember ( "Snr", "MC1344",  
												"Jock", "Allan", "Mr", "M", 
												"31-12-2013".Date, ad, "McTavish" );
		//-------------------------------------------------------------------------------------
	create bfs;									// a BookForSale
		bfs.loadBookForSale ( "Marner, Silas", "Poetry",  30,  "1st", "6 335833 0", 42.99, bSell, "Modern Etruscan Poetry", 0.14 );
		//-------------------------------------------------------------------------------------
	commitTransaction; 	/*  (We shall not bother to create a BookOrderNote)
							You will notice that we have tried to sequence these methods so as
						  	 to minimise the occasions when a reference is needed but that
							object has not been created yet.  */
end;
