Sie sind auf Seite 1von 20
Sheet#8 Registration System Class Diagram + Coding CAP252 - Entesar Al-Mosallam
Sheet#8
Registration System
Class Diagram + Coding
CAP252 - Entesar Al-Mosallam

Class Diagram

Class Diagram

public class website

{

private CourseCatalog courseCat; private Student student; private Committee committee; private Admin admin;

//---------------------------

public void CreateNewRequest( int secNum, int CourseNum)

{

Vector PreqList = courseCat.getPreqList(CourseNum); boolean pass = student.check(PreqList);

if (pass) student.createReq(secNum);

 

}

 
   

//---------------------------

 

{

public void updateInstName(int secNum, String name)

committee.updateInstName(secNum,name);

}

//---------------------------

public void submitRequest()

{

 

student.submitRequest();

 

}

//---------------------------

public void Define(int courseNum, Vector<Course>list)

{

admin.Define(courseNum,list );

}

//---------------------------

public void Assign(int courseNum, int level)

{

admin.Assign(courseNum, level);

}

//---------------------------

}

public class Committee

{

private ManageSection Msec;

public void updateInstName(int secNum, String name)

}

{

}

{ private ManageSection Msec; public void updateInstName(int secNum, String name) } { } Msec.updateInstName(secNum, name);

Msec.updateInstName(secNum, name);

public class ManageSection

{

private SectionCatalog secCat;

}

{

}

public void updateInstName(int secNum, String name)

SectionCatalog secCat; } { } public void updateInstName(int secNum, String name) secCat.updateInstName(secNum, name);

secCat.updateInstName(secNum, name);

public class SectionCatalog

{

private Vector<SectionSpecification> secSpecVector;

{

public void updateInstName(int secNum, String name)

{ public void updateInstName(int secNum, String name) SectionSpecification secSpec = findSection( secSpecVector ,

SectionSpecification secSpec = findSection( secSpecVector , secNum ); secSpec.updateName(name);

}

public SectionSpecification findSection(Vector<SectionSpecification> secSpecVector,int

secNum)

{

//This method search in the collection object (the Vector here)

}

}

public class SectionSpecification

{

}

private Section sec;

{

}

public void updateName(String name)

public class SectionSpecification { } private Section sec; { } public void updateName(String name) sec.updateName(name);

sec.updateName(name);

public class Section

{

private Instructor inst;

}

{

}

public void updateName(String name)

public class Section { private Instructor inst; } { } public void updateName(String name) inst.updateName(name);

inst.updateName(name);

public class Instructor

{

private String name;

}

{

}

public void updateName(String name)

public class Instructor { private String name; } { } public void updateName(String name) this.name =

this.name = name;

public class Admin

{ public void Define(int courseNum, Vector<Course> list ) { ManageCourse mCourse = new ManageCourse();
{
public void Define(int courseNum, Vector<Course> list
)
{
ManageCourse mCourse = new ManageCourse();
mCourse.Define(courseNum,list );
}
public void Assign(int courseNum, int level)
{
ManageCourse mCourse = new ManageCourse();
mCourse.Assign(courseNum, level);
}
}

public class ManageCourse

{

 

private CourseCatalog courseCat;

 

public void Define(int courseNum, Vector<Course> list)

{

   
 

courseCat.Define(courseNum,list);

 

}

 

public void Assign(int courseNum, int level)

 

{

 

courseCat.Assign(courseNum, level);

 

}

}

public class CourseCatalog

{

private Vector<CourseSpecification> CourseSpecVector;

public Vector<Course> getPreqList(int courseNum)

{

 

CourseSpecification courseSpec = findCourseSpec(CourseSpecVector, courseNum); return courseSpec.getPreqList();

}

{

public void Define(int courseNum, Vector<Course> list)

 
 

CourseSpecification courseSpec = findCourseSpec(CourseSpecVector, courseNum); courseSpec.Define(list);

}

 

public void Assign(int courseNum, int level)

{

 

CourseSpecification courseSpec = findCourseSpec(CourseSpecVector, courseNum);

courseSpec.Assign(level);

 

}

public CourseSpecification findCourseSpec( Vector<CourseSpecification> CourseSpecVector,int courseNum)

{

//this method search in the collection object (vector here)

}

//-----------------------

}

public class CourseSpecification

{

 

private Course course;

public Vector<Course> getPreqList()

{

 

return course.getPreqList();

}

{

public void Define(Vector<Course> list)

course.Define(list);

}

public void Assign(int level)

{

course.Assign(level);

}

}

public class Course

{

 

protected int level; protected Vector<Course> preqList;

public Vector<Course> getPreqList()

 

{

return preqList;

}

{

public void Define(Vector<Course> list)

preqList= list;

}

public void Assign(int level)

{

this.level= level;

}

}

public class FinishedCourse extends Course

{

}

private double grade;

public class FinishedCourse extends Course { } private double grade;

public class Student

{

 

private Transcipt transcipt; private Vector<Request> requests; private Advisor advisor;

 

public boolean check( Vector<Course> preqList)

{

 

}

return transcipt.check(preqList);

public void createReq(int secNum)

{

Request req = new Request(); req.setSecNum(secNum); req.setStatus("pending"); requests.addElement(req);

}

public void submitRequest()

 

{

Email email = new Email(requests, advisor.getEmailAddress());

email.send();

}

}

public class Transcipt

{

private Vector<FinishedCourse> finishedCoursesVector;

}

{

}

public boolean check( Vector<Course> preqList)

} { } public boolean check( Vector<Course> preqList) if (finishedCoursesVector.contains(preqList)) return true;

if (finishedCoursesVector.contains(preqList)) return true; else return false;

public class Request

{

private Date date; private int requestNum;

private String status; private int secNum;

 

public void setSecNum(int s)

{

secNum = s;

}

public void setStatus(String s)

{

status = s;

}

}

public class Advisor

{

private String emailAddress;

}

{

}

String getEmailAddress()

public class Advisor { private String emailAddress; } { } String getEmailAddress() return emailAddress;

return emailAddress;

public class Email

{

 

private Object emailBody; private String emailAddress;

{

public Email( Vector<Request> requests, String emailAddress)

emailBody = requests; this.emailAddress = emailAddress;

}

public void send()

 

{

}

}