5.1 Administrator Interface (admin.sl)

5.1 Administrator Interface (admin.sl)

(****
 *
 * This file defines the objects and operations related to the administrator interface.
 * All of the objects and operations of the database can be found within their respected
 * specification files. This file only models the unique viewing features for the administrator.
 *
 *)

object DBViewPane
	components:
		DBView;
	description: (*
		Shows the chosen database.
	*);
end DBViewPane;

operation ChangeViewPane
	inputs: DBView, DBViewPane
	outputs: DBViewPane
	
	description: (*
		Changes the viewing pane to show the database view that has been passed
		in.
	*);
end ChangeViewPane;

object DBView = InstructorDB or CourseDB or RoomsDB;
object InstructorDB;
object CourseDB;
object RoomsDB;

object ScheduledTerm
	components:
		Term;
	description: (*
		Specifies the term quarter and term year for the schedule to be generated.
	*);
end ScheduleTerm;

object Term
	components:
		Quarter and Year;
	description: (*
		A specific school term, holding the quarter and the year.
	*);
end Term;

object Quarter
	components:
		Fall or Winter or Spring or Summer;
	description: (*
		A school quarter.
	*);
end Quarter;

object Year = int;

object Fall;
object Winter;
object Spring;
object Summer;

object TermDB
	components: Term*;
	description: (*
		Holds the information of terms created, no duplicates
	*);
end TermDB;

operation AddTerm
	inputs: ti:Term, tdb:TermDB
	outputs: tdb':TermDB
	
	precondition: 
		(* 
		 * The term being added does not already exist within
		 * the database 
		 *)
		 
		 (not (exists (ti' in tdb) ti' = ti));
		 
		 and 
		 
		 (* 
		  * The term being added is not empty.
		  *)
		  
		  (ti != nil);
		
	postcondition:
		(*
		 * The new term has been added into the database and all of the
		 * terms already in the database are still in the database
		 *)
		 
		 tdb' = ti + tdb;
		 
	description: (* 
		Adds the new term into the term database list, does not
		add duplicates
	*);
end AddTerm;

operation GenerateSchedule
	inputs: InstructorDB, CourseDB, RoomsDB, ScheduleTerm
	outputs: GeneratedSchedule
	description: (*
		Generates a schedule with the databases and term information
	*);
end GeneratedSchedule;






Prev: instructor_view.sl Next: InstructorDB.sl Up: spec Top: index