Lab 5
[valid 2025-2026]
Starting from this week...:
- Pay attention to exception handling (otherwise: -0.5 points)
- Create your own types of exceptions to report abnormal events related to application execution.
- Organize your classes and interfaces in packages.
Bibliography Management System
Write an application that can manage a catalog of resources (bibliographic references), such as books, articles, etc.
These resources might be represented by files in the local file system or a Web address.
Apart from a unique identifier, a title and its location, a resource may have additional properties such as author(s), what year it was publihsed, description, etc.
You may read more about reference management software,
see a comparison of notable implementations, such as JabRef.
Example of entries in the catalog might be:
{"id":"knuth67", "title":"The Art of Computer Programming", "location":"d:/books/programming/tacp.ps", "year":"1967", "author":"Donald E. Knuth"};
{"id":"jvm25", "title":"The Java Virtual Machine Specification", "location":"https://docs.oracle.com/javase/specs/jvms/se25/html/index.html", "year":"2025", "author":"Tim Lindholm & others"};
{"id":"java25", "title":"The Java Language Specification", "location":"https://docs.oracle.com/javase/specs/jls/se25/jls25.pdf", "year":"2025", "author":"James Gosling & others"};
The main specifications of the application are:
Compulsory (1p)
- Create an object-oriented model of the problem.
Create a class responsible with the operations regarding the repository of resources.
- Implement the following:
- create an object that represents the repository;
- add some resources into the repository;
- open a resources using the Desktop class.
Homework (2p)
- Represent the commands using classes instead of methods. Use an interface or an abstract class in order to desribe a generic command.
Implement the commands save, load, list, view, report, etc..
- list: prints the catalog of resources on the screen;
- view: opens an resource using the native operating system application;
- report: creates (and opens) an HTML report representing the content of the catalog.
Use a template engine such as FreeMarker
or Velocity, in order to create the HTML report.
- The application will use at definet at least one custom exception type.
- The final form of the application will be an executable JAR archive. Identify the generated archive and launch the application from the console.
Advanced (2p)
- Suppose there is an official set of concepts (keywords) C, and that each resource has a list of such concepts.
Evolve your model in order to support this new feature.
You may use keywords from the ACM classification system.
Choose your own set of keywords, for example: C = {Graph theory, Neural Networks, Algorithm design techniques, Object-oriented programming}
and assign them to resources as you consider.
- Write an algorithm that determines a set of resources that covers all the concepts in C. Can you find a minimum set?
- Create random instances of the problem and test the performance of the algorithm.
Resources
Objectives
- Use basic I/O streams.
- Understand the difference between byte and character streams, primitive and decorator streams.
- Use File I/O to works with files and directories.
- Handle exceptions using try-catch-finally blocks.
- Handle resources using try-with-resources statements.
- Create custom exceptions and chained exceptions.
- Use regular expressions and glob patterns
- Understand the notion of CLASSPATH.
- Use external JAR libraries.
- Package all project classes as an executable JAR file.