This javadoc links to the source code
The javadoc tool has -linksource option which implements this. The links are under class and method names.
No Unit Tests Included
There are no JUnit tests included. However, many applications would benefit
from using JUnit test classes - especially for the Model Objects
(eg {@link hirondelle.movies.edit.Movie}).
Don't use extends unless you have to
A dialog does not have to extend JDialog.
Instead, you can almost always use a JDialog as a field, not as a superclass.
The reasons for doing so include :
Default scope
The default scope for classes is package-private.
Scope is increased to public only when needed.
Final is preferred
Classes that aren't designed explicitly for overriding (the great majority of classes) are declared final.
Dialog policies are centralized
The {@link hirondelle.movies.util.ui.StandardDialog} class centralizes a number of policies for dialogs.
This both reduces code repetition, and helps give your app a uniform look. The StandardDialog class
is an example of the Template Method design pattern.
Package-by-Feature is used
All items related to a single feature are placed in single directory/package devoted exclusively to that feature.
Custom Exception Handler
The {@link hirondelle.movies.exception.ExceptionHandler} class customizes how Java behaves when a RuntimeException occurs.
Invalid User Input
When user input is found to be invalid, a checked exception named
{@link hirondelle.movies.exception.InvalidInputException} is thrown by a Model Object constructor (for example,
see {@link hirondelle.movies.edit.Movie}).
Logging
This app uses JDK Logging. The app logs to a file in the application's home directory. The logging is set up in
{@link hirondelle.movies.LaunchApplication}.
Font
The app uses a custom font for all components.
Relations between classes in the same feature
This app shows two styles for "wiring" classes together.
In the Login feature, the Controller comes first:
{@link hirondelle.movies.LaunchApplication} -> {@link hirondelle.movies.login.LoginController} -> {@link hirondelle.movies.login.LoginView} (dialog)
In the case of the Edit Movie feature, the Controller is called later:
{@link hirondelle.movies.main.MainWindow} -> {@link hirondelle.movies.edit.MovieActionAdd} (simple Swing Action) -> {@link hirondelle.movies.edit.MovieView} (dialog) -> {@link hirondelle.movies.edit.MovieController} -> {@link hirondelle.movies.edit.Movie} (model) -> {@link hirondelle.movies.edit.MovieDAO} (data access)
Coding Conventions
Short Methods
Most methods are quite short. This significantly improves maintainability. Even one-line methods are used,
wherever it increases clarity for the maintainer.
Table Sorting
The {@link hirondelle.movies.main.MainWindow} contains a table. Clicking
on a table column header resorts the table, ascending and descending.