The Design Principles (Java Programming)
1. System overview
A University Department needs a set of interfaces and classes tomanage student data.
The Department has three types of students – undergraduates(UG), postgraduate taught (PGT) and postgraduate research (PGR).Students cannot be more than one type. For this coursework, thesignificant difference between undergraduate and postgraduatetaught students is that undergraduate students take 120 creditsworth of courses in a year whereas postgraduate taught studentstake 180. Furthermore, the pass mark for undergraduate modules is40%but for postgraduate taught modules is 50%. Postgraduateresearch students have a supervisor but do not register formodules.
The University needs to maintain a record of modules andsupervisors for students in an academic year. The system shouldallow module and supervisor information to be read fromappropriately defined data files. The files should contain one dataentry per line with fields separated by a comma e.g. MCS3008,Advanced Programming, 20. The system should allow an appropriatenumber of modules to be added to a student record and to recordwhether or not a student is correctly registered (are they takingthe right number of credits or do they have a supervisorallocated).
In addition, the University needs to be able to issue smartcards and login ID’s to all students on their courses. Thefollowing provides more detail on the required functionality:
This method returns the number of students of the specified typethat are currently enrolled.
This method registers a new student onto the system andallocates a student ID (see below).
amendStudentData (studentID, studentData)
This method changes a student record.
This method removes the student record associated with the givenstudent number. In effect, the student is leaving theUniversity.
When issuing a smart card, the following rules must beobserved.
– An undergraduate student must be at least 17 years old.
– A postgraduate student must be at least 20 years old.
– A student cannot be issued with more than one smartcard (i.e.do not try to deal with lost cards!)
All students have the following publicfunctionality:
– a method to get the student’s ID.
– a method to get the student’s type (UG, PGT, or PGR).
– a method to list the modules that the student is registeredfor. A module consists of a name (e.g. Programming 2 ), a modulecode ( e.g. MCS1628) and the number of credits associated with themodule (e.g. 20).
– a method which returns true if the student is currentlyregistered for enough credits (120 for undergraduate, 180 forpostgraduate taught, 0 for postgraduate research) and falseotherwise.
– postgraduate research students have a method to return thename of their supervisor (a Name).
You must provide an appropriate hierarchy for students.
A student ID has two components – a single letter followed by afour digit number. For example:
You must provide access to each component and an appropriatestring representation of the ID.
Student ID’s are unique. You must guarantee that no two studentshave the same ID.
A Smart Card has the student’s name (comprising a first and lastname), the date of birth of the student, a unique Smart Card numberand a date of issue.
The Smart Card number has three components. The first componentis the concatenation of the initial of the first name of thestudent with the initial of the last name of the student. Thesecond component is the year of issue of the card. The thirdcomponent is an arbitrary serial number. For example, the stringrepresentation of the Smart card number for a card issued to ColinJones in 2019 would have the form:
where the 10 is a serial number that, with the initials andyear, guarantees the uniqueness of the card number as a whole.
Your Smart Card class must provide methods to access thestudent’s name, the student’s date of birth, the student ID and thedate of issue of the Card.
You should provide appropriate classes for a student’s name andfor a smart card number.
You must guarantee the the uniqueness of smart card numbers.
You should use the java.util.Date class to represent dates.However, you must not use deprecated methods of the Date class. So,for example, in your test classes use java.util.Calendar toconstruct dates of birth and dates of issue of Smart Cards. You canassume default time zone and locale.
Note: Java 8 provides a much more satisfactory way of handlingdates and time with immutable classes. However, in this courseworkit is expected that you can use sub-optimal classes such as Dateand so its use in this project is mandatory.
The smart card should have the followingprivate method:
– setExpiryDate(); which sets an expiry date for the card. Ifthe smart card is held by a UG student, the expiry date is set tothe issue date plus four years. If the smart card is held by a PGTstudent, the expiry date is set to the issue date plus two years.If the smart card is held by a PGR student, the expiry date is setto the issue date plus five years.
The smart card should have the following publicmethod:
– getExpiryDate(); which returns the expiry date of thecard.
Your solution should include your interfaces and classes thatcomprise the implementation of the system and types outlined inSections 1 and 2. In addition, you should provideseparate test classes that demonstrate testing of yoursolution.
In this coursework you should demonstrate:
– the sensible use of Java inheritance mechanisms,
– an understanding of how to declare and use interfaces;
– the ability to handle collections of objects,
– the use of late binding,
– the use of defensive programming, including use ofimmutability and appropriate error handling,
– an understanding of when and how to override Objectmethods,
– the implementation of object factories.
5. Further notes
Start with the simpler classes first (e.g. Module, Name,StudentID, SmartCardNumber and SmartCard) You can implement thedifferent types of student before implementing the managementsystem class. Unit test classes as you progress through thecoursework.
For each class you implement you should consider:
– whether to override Object methods (equals, toStringetc.),
– whether to use an interface-based hierarchy, and
– whether the class should be immutable.
– whether to use an object factory.
Note – The coursework is notabout development of an end-user application. You are developinginterfaces and classes that could be used for the development of anapplication. You should not develop a graphicaluser interface or a command line interface. They arenot necessary. The student support system so farspecified is a deliberate simplification.Your solution shouldcorrespond to the simplicity of the specification.
Please help, greatly appreciated!