1.Introduction

XYZZY Software has been approached by CQU to develop a system to assist unit coordinators in the management of marks. The system will be initially trialled for COIT20258 and a phased implementation strategy will be adopted. This document reflects the current state of the design for the Phase 1 system.

2.Requirements

Because of the simplicity of the user requirements, the corresponding use cases are not duplicated here, as would be the case in a normal XYZZY design document.

The purpose of the system is to assist a course coordinator in the management of student results. A Java desktop application is to be developed, driven by a simple Swing GUI. Interaction between the database and the application is to be via JDBC. The NetBeans IDE is to be used for development. Java DB must be used as the database.

The Phase 1 user requirements are as follows:

1. Start the application and connect to the database. If a connection cannot be established, the application must exit.
2. Close the database connection and stop the application
3. Display all records
4. Display the record for a specified student
5. Display all records where the total mark is within a specified range
6. Update the exam mark and total mark for a specified student.
7. Clear the display

In addition, it has been decided that the architecture of the application must conform to the MVP (Model View Presenter). Also, the design detailed in the class diagram in Section 6 must be followed.

The database design and sample data are provided in Section 4. Data validation is not required at this stage. However, basic preconditions must be satisfied for each requirement and if these are not satisfied, an appropriate message is to be displayed. These preconditions are specified in Section 8.

3.Architecture

A three-layered architecture will be employed in Phase1, consisting of view, presenter and model layers. Given the simplicity of the architecture, an architecture diagram is not provided.

Layers are to be modelled as packages the package structure for the application is illustrated in Figure 1.

Figure 1. Package structure see image.

4.Database / Data Access Design

The SQL script that will be used to test the application is given below.

DROP TABLE MARKS;
CREATE TABLE MARKS
(
STUDENTID VARCHAR (8) NOT NULL,
ASSIGNMENT1INT NOT NULL,
ASSIGNMENT2INT NOT NULL,
EXAMINT NOT NULL,
TOTALINT NOT NULL,
GRADE VARCHAR (4) NOT NULL,
PRIMARY KEY (STUDENTID)
);
INSERT INTO MARKS(STUDENTID,ASSIGNMENT1,ASSIGNMENT2,EXAM,TOTAL,GRADE)
VALUES
('S01',20,0,25,45,'?'),
('S02',0,0,0,0,'?'),
('S03',15,0,0,15,'?'),
('S04',15,15,19,49,'?'),
('S05',25,20,39,84,'?'),
('S06',0,0,45,45,'?'),
('S07',25,25,0,50,'?'),
('S08',20,20,25,65,'?'),
('S09',20,20,24,64,'?'),
('S10',17,19,39,75,'?');

As there is only one table, an ERD is not provided.

Data access will be via JDBC using prepared statements. Java DB must be used as the database.

Normally, in an XYZZY design document, we would specify the queries in this section and relate them to the methods exposed by the ResultsQueries class described in Section 6. However, for this project, we have decided to leave query formulation to the implementers.

5.GUI Design

Developers are free to use the NetBeans GUI Builder or alternatively, they can hand code the complete GUI.An indicative GUI is presented in Figure 2 and Table 1. Developers are free to use this design as is or to do things differently, for example using menus for data entry. Note that because of the simplicity of the GUI in Figure 2, screen shots for the realisation of each requirement are not shown as would normally occur in an XYZZY design document. Rather, selected screen shots are shown and the required actions are summarised in Table 2.

Figure 2. Indicative GUI see image.

Table 1.Mapping of GUI functionality to Swing component types. see image.

Table 2.Mapping of requirements to actions see image.

Note that in Figure 2, the Grade field is not used.

In this phase, browsing is not required and query results can be displayed in a test area as shown below:

Figure 3.Output from an All Students query see image.

In Figure 3, I have made use of a simple Result.toString() method. Also note that I display messages in the text area (e.g. missing preconditions, no results returned, etc.):

Figure 4. Output from an All Students in Range query see image.

Note that the IView interface contains a single display() method which is to handle both normal and abnormal output. With exceptions, there is no need to display a message, as the expectation is that when a query throws an exception, the application will exit. However, do print a stack trace to standard output.

For requirement5, note that clicking of the Total Marks in Range button will result in the invocation of a single method.If two numbers are specified as input, then they are to be treated as the lower bound (left) and upper bound (right) of an inclusive range. Having the upper bound less than the lower bound is to be treated as an error. Having both numbers the same is not an error they are the endpoints of a range of length zero.If one number is specified, then if it is the right input, it is an error. If it is the left input that is specified, then the right input is set to the value of the left input.

The class diagram for the application is illustrated in Figure 3.

Figure 3. Class diagram see image.

Note the following:

  • Data validation and any associated type conversion is to be performed in ResultsView
  • GUI startup (setVisible() invocation) is to be performed in Results
  • ResultsPresenter will need to catch exceptions thrown by the IQueries methods. However, once caught, just print a stack trace and exit the application
  • There is only one main() method in Results.

The mapping to packages/layers is provided in Section 3. Note that Figure 3 represents a refactoring of the class structure favoured by the NetBeans GUI Builder. Rather than having GUI creation in the GUI class definition(through the provision of a main() method, we have chosen to place GUI creation in a separate main class. If you are using the NetBeans GUI builder, all that this means is that the main() method that the Builder generates is moved into the Results class. Also note that interaction between the ResultsQueries class and the JBC library classes is not shown. This is normal for class diagrams. Finally, formal UML syntax is not strictly followed. In particular, we feel felt that method signatures as employed in NetBeans are clearer than their UML counterparts. In this regard, note that if no return type for a method is specified, void is assumed.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.