The scenario is inspired by a library management system


Implement a program to:

- use a GUI interface to control and display the results of the program,
- read a text data file,
- instantiate appropriate classes,
- create an appropriate internal (multi-tree) data structure,
- display the structure in a convincing way using a JTextArea, and
- search the structure.

Elaboration:

The scenario is inspired by a Library Management System (LIMS). For the first version of the project, the LIMS is a very basic one, allowing just for the import of data from a text file and perfom some basic search operations.

The elements of the LIMS are: the Library itself (let's consider just one instance for now) that contains a collection of Authors. Each Author
includes a collection of Books he/she published.

Eventually (in the next versions of the project), there will be clients that will concurrently access the LIMS in order to borrow/return book
copies.

The Author and Book classes will have some attributes, mainly used for searching and sorting.

1. Required data structure - the data structure I want you to implement is a multi-tree with the following levels:

1. Library - Level 0
2. Author - Level 1
3. Book - Level 2

2. Use at least the following classes, you are free to define others in the spirit of this application.

Specifications for a few classes - you are free to add to this list.

- Library
- ArrayList as an instance variable data structure
- Author - index, a name, an address and list of a number of Books (accessed by links to instances of the Book class).
- ArrayList as an instance variable data structure
- Book - index, a title, a genre, author by index
3. Use the ArrayList class to hold instances of the classes defined in item 1. Be sure to use generics appropriately.
4. Use a text data file with the following format - which you may extend, and may be extended in the later projects. As a minimum, each item should be specified by a single line in the data file. The initial fields should be used during the instantiation of objects and your program should ignore later fields that are not used. For simplicity, let us assume that the fields are separated by colons. The specifications look something like the following, where the angle brackets are not part of the actual data file. I think we can assume that name, address, title and genre are strings.

- b:::::
- a:::
Your program should
- work if there are additional fields on some lines,
- ignore blank lines,
- ignore lines starting with a / (as comments),
- accept spaces within names and types, and
- ignore extra spaces around the :'s nicely.

1. All the classes should be provided with appropriate:
- constructors
- toString implementations
- additional methods
- instance variables connecting the class to appropriate instances of other classes

1. A GUI that will allow the user to do at least the following operations:
- Select the data file at run time, using JFileChooser starting at dot.
- Show the internal data structures in a text area
- Search for an item by index, title or genre. For example, the book whose title is "Java Basics".
- Resize nicely in a JFrame.

1. The GUI class(es) should be distinct from the other classes in the program. Hmm - this is the statement in the common syllabus, but I am not so sure this is always a good idea, nor exactly how appropriate this requirement is for this project. This is an interesting topic to explore in the Weekly Conference.

Deliverables

1. Java source code files
2. any configuration files used including your data file
3. a well-written document including the following sections:

1. Design: including a UML class diagram showing the type of the class relationships

2. User's Guide: description of how to set up and run your application

3. Test Plan: sample input and *expected* results, and including test data and results, with screen snapshots of some of your test cases

4. (optionally) Comments: design strengths and limitations, and suggestions for future improvement and alternative approaches

5. Lessons Learned

6. Use one of the following formats: MS Word doc, docx, OpenOffice odf, pdf, rtf.

Format

(The following is from the standard syllabus, but I really don't care about any of these details. Your document should be easy to read and convey the information about your project in a reasonable manner. If you wish to follow a style, I would suggest IEEE or ACM style rather than APA.)

Documentation format and length. The documentation describing and reflecting on your design and approach should be written using  Microsoft Word, and should be no more than five pages in length and no less than two pages. The font size should be 12 point. The page margins should be one inch. The paragraphs should be double spaced. All figures, tables, equations, and references should be properly labeled and formatted using APA style.

- Code format:
- header comment block, including the following information in each source code file:
- file name
- date
- author
- purpose
- appropriate comments within the code
- appropriate variable and function names
- correct indentation
Sample data file:
// sample data file for CMSC 335, Spring 2014
// Mihaela Dinsoreanu
// Jan 5, 2014
// Books format:
// b:::::
b : 10001 : Java Basics : Science : 11.50 : 20001
b : 10002 : Advanced Java : Science : 10.99 : 20001
// Authors format:
// a:::
a : 20001 : John Smith : Computers St. 50 Seattle
a : 20002 : Mary Jones : Literature Lane 25
------------------------------
Some more thoughts you might want to consider:

Generally, the project should be what call "in the Java spirit" - by which I mean defining and using classes, variables and methods appropriately.

Some examples:

1. You should ask yourself if it makes sense to instantiate a class more than once. This has implications for which variables should be local to a method, which methods should be instance vs class (static) and which variables should be instance vs class.

2. For example, if you are going to use a class like a Library class to contain everything, it makes sense to have more than one library, and
each library could have its own data file.

3. In a Library, some students have pointed out the there might be other types of publications besides Books. How should we handle these?

I suggest a single data structure to handle the lot - an ArrayList is most appropriate, but that structure is generic, so what kind of generic declaration should we use, perhaps ArrayList , but that seems like a too general structure since we don't really want stuff like JLabel or JButton this structure. Thus, we are lead to proposing another class, say LibraryElement, and the Book class should extend this class, and then we can use the following declaration: ArrayList to hold stuff that is just lying around.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: The scenario is inspired by a library management system
Reference No:- TGS0664476

Now Priced at $70 (50% Discount)

Recommended (94%)

Rated (4.6/5)