Mike Day - 2008-12-08

Will,

Here are my initial thoughts on what the UI will need from your Middle Layer.  This is all in reference to the quick and dirty UI sequence described in:
https://sourceforge.net/forum/forum.php?thread_id=2643761&forum_id=894518

I will basically be sending you data in request for additional data.  Let's discuss some prototype function names that will accomplish this.  Of course, some of these functions will be complicated, and you may want to break them down into a sequence of simpler requests sent to the backend layer.  Also, this may end up being more work than the actual UI coding; I will happily offer to take some of the burden of coding the Middle Layer if this is indeed the case.

Functions Needed:

IsStudent(StudentId) -> should return true if the StudentId is actually in the system, so the UI can proceed past the login.  This simply amounts to seeing if there is a row in the Transcript table where the field StudentId matches the one provided to the function.

GetProgram(StudentId) -> needs to two things: 1. the name of the program, and 2. a table with fields (Semester, SeqId, RequirementText, Fulfilled).  The UI will use this to display frame A.  There will be an entry in the list for each requirement item in the student's corresponding program.  The first two fields will be used to display the data in an ordered fashion, just like in the catalog, to reduce confusion.  The RequirementText field needs to declare what courses or groups will satisfy that requirement, which amounts to querying for all courses or groups that correspond to that requirement, and then building a text string based on their catalog numbers (CatNum) or Name.  The fulfilled field is simply a boolean that is true if there is a course in the student's transcript that fills that requirement.  Determining this will amount to a rather complex query that you should probably discuss with Matty.

(we can omit the first two fields for the prototype just to keep it simple, although it is something I think we will want to add pretty early, later on)

GetOfferings(StudentId) -> Needs to return a list of catalog numbers for all courses currently offered that MAY fulfill an outstanding requirement of the specified student's program.  The amounts to getting a list of all course offerings (CRN#'s), collapsing the list to a set of corresponding CatNum's, then deleting all entries for which an auxiliary function MayFulfill(StudentId, CatNum) returns false.  MayFulfill() must return true only if the specified student has a degree program requirement which has not yet been fulfilled by their transcript but which can be fulfilled by the specified CatNum.  Again, this may be profitably broken down into a sequence of simpler operations.  This function will allow the UI to display frame B.

GetZeroConflictOfferings(CatNumList) -> Needs to return a list of CRN's that correspond to the provided CatNum's, subject to the following restraints:
1. For each CatNum, the returned list will contain AT MOST 1 corresponding CRN.
2. The set of all returned CRN's must not correspond to any conflicting timespans.
This is basically a reiteration of what was stated in step 3 of the UI sequence.  I will gladly help in the development of this algorithm if needed.  It is the core of the whole project.  There may be a simple but very slow solution.  Considerable optimizations may be possible.

GetTimeSpans(CRN) -> returns the complete list of timespans that correspond to a given CRN.  The UI will use this in combination with the former in order to display frame C.

What do you think?

Feel free to disagree/correct/improve anything, or to propose an entirely different approach if you think it's warranted.

- Mike