DVD Collection GUI II is a program written by Dan Campbell in Java that uses a mySQL connection to manipulate the contents of a relational database. The program…
DVD Collection GUI II is a program written by Dan Campbell in Java that uses a mySQL connection to manipulate the contents of a relational database. The program is designed to hide the user from the technical workings of database functionality, providing only graphical widgets with which to issue commands. As such, it can be used with no awareness of the underlying database software.
Prior to DVD Collection GUI II, two earlier programs were produced for managing a DVD collection.
DVD Collection GUI does not use database functionality, but instead serialisation and file IO. Aside from the difference in its source of data, the program has a similar front end and back end to DVD Collection II, as this was the original task upon which the latter was based.
DVD Collection GUI Mk II was the original and unsuccessful version of DVD Collection II. The original purpose of this program was to replicate DVD Collection GUI almost verbatim, with the only difference being a direct replacement of serialisation and file IO code for mySQL interfacing code. The program was operational but unreliable due to runtime errors.
The principle functionality of the program includes:
The task specifications required that the program be written using a provided class, DVD, as well as being based around the DVD Collection class used in the earlier program DVD Collection GUI. From this, a DVD Collection GUI class was required, plus classes for adding and editing DVDs.
The graphical layout of the task was also to be similar to the earlier DVD Collection GUI program; using 3 windows to perform its main operations.
The main window was used for viewing, selecting, sorting, counting and deleting DVDs, as well as providing author information. It was required to contain:
The New DVD window was used to create a new DVD listing from scratch by providing the title, year and status as a favourite. It was required to contain:
The Edit DVD window was used to change the title, release year and favourite status of a selected DVD, and was designed to mimic the layout of the New DVD window as much as possible. It was required to contain:
The task required that at least 5 classes be used: DVDCollectionGUI, DVDCollection, DVDAddFrame, DVDEditFrame, and DVD.
DVDCollectionGUI represents the main window, all of its widgets, and the actions initiated by those widgets. With the exception of the About menu item, all of the operations initiated from the DVDCollectionGUI class are handled by other classes. It instantiates a DVDAddFrame or DVDEditFrame object when the New DVD or Edit Info buttons are pressed, respectively, and invokes DVDCollection class methods when responding to user action on its widgets related to counting, deleting and sorting. Rather than use two buttons for sorting by title and ID, this class only defines 1 sorting button and toggles that button's label and function each time it is pressed.
DVDAddFrame is a class representing a child window. This class contains all widgets of the New DVD window and their functionality. Its main role is to check data hygiene before calling the DVDCollection class using that data. On top of the task requirements, this class also contains an extra text field which is used to report the success status of the most recent attempted DVD addition.
DVDEditFrame is another class representing a child window. This class contains all widgets of the Edit DVD window and their functionality. Its main role is to check data hygiene before calling the DVDCollection class using that data. On top of the task requirements, this class also contains an extra text field which is used to report the success status of the most recent attempted DVD alteration.
DVDCollection represents a collection of all DVDs and provides all functionality involved with altering that collection. As the collection is updated, so too must be the database, and the DVDCollection class was also designed to handle all interfacing between the Java program and the SQL database. It does this invisibly to all other classes.
DVD is a minimal class with fields representing a DVD's properties (ID, title, release year, and status as a favourite) and functionality that only sets or returns those fields' values. A task requirement was that this class be left untouched. To this end, the DVD class does not implement the Serializable interface, meaning that serialisation could not be used for storage, nor the Comparable interface, meaning that DVDs had to be sorted either manually or via database communications. This is noteworthy since the earlier project, DVD Collection GUI, did allow such use of the Comparable interface with its DVD class.
An example that makes use of most of these classes is as follows:
private void editBtnActionPerformed(java.awt.event.ActionEvent evt)
{
DVDEditFrame editDVDWindow = new DVDEditFrame(this, m_collection, (DVD)dvdJList.getSelectedValue());
}
The method editBtnActionPerformed is called by the DVDCollectionGUI class each time the user presses the Edit Info button widget in the main window. It creates a new object of the DVDEditFrame class using a reference to a DVD object which contains the data that is being edited, and a reference to the DVDCollection object which contains the methods that can apply the edits made to the collection and database.
The program's visual layout was built using the design editor in the Netbeans IDE 7.2. It heads its 3 windows with the palette of a unicorn: cyan, pink and purple.
The New DVD button is adorned with a picture of Sonic the Hedgehog, rendered by Dan Campbell, casting an expression of surprise upon discovering the giant Master Emerald on a grassy hill. Due to sizing issues, the emerald was cropped out for the program.
Colour-coding is used in the status text fields for the New DVD and Edit DVD windows. If there is an error in the given data, the status field presents an error message on a pink background. If the operation was a success, the status field announces "Updated" on a green background. If the data is valid but the database could not be updated correctly, the status field turns a deep red and reports "Database error."
There are many areas of design in which DVD Collection GUI II could be improved.
Upon submission for appraisal, the program was met with a final judgement of "Well done - pass!"

The pickerel frog is a small frog in North America. It has dark squares on its back. The squares are in lines instead of randomly scattered. Leopard frogs have circular spots. They have an orange or yellow coloration on the inside of their back legs. They are mainly found in the eastern United States, with a little in southern Canada. They have toxic glands in their skin that can kill other frogs.
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.