My Movies 1.0.0

hirondelle.movies.edit
Class MovieDAO

Object
  extended by MovieDAO

public final class MovieDAO
extends Object

Data Access Object (DAO) for Movie objects.

Implements persistence for movie information. This class uses a simple text file called movie_list_for_<user name>.txt, stored locally, in the application's home directory. Each logged in user gets their own list. Each logged in user can see their own list, but they cannot see anyone else's list.

The format of the file is specific to this application. The file should not be edited directly by an end user, in case the format is violated.

Upon startup, all records in the datastore are read into memory. Edits are performed initially only in memory. When the application shuts down, then the updated data store is written back to the disk, for use during the next launch of the application.


Constructor Summary
MovieDAO()
           
 
Method Summary
(package private)  void add(Movie aMovie)
          Add a new Movie.
(package private)  void change(Movie aMovie)
          Change an existing Movie.
(package private)  void delete(String aMovieId)
          Delete an existing Movie, given the movie id.
(package private)  List<Movie> list()
          List all Movies.
 void shutdown()
          Save all data to a text file.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MovieDAO

public MovieDAO()
Method Detail

shutdown

public void shutdown()
Save all data to a text file. Must be called explicitly when the app shuts down, in order to save all edits.


add

void add(Movie aMovie)
Add a new Movie.


change

void change(Movie aMovie)
Change an existing Movie.


list

List<Movie> list()
List all Movies. Order is the natural order of the Movie class (descending date, then title).


delete

void delete(String aMovieId)
Delete an existing Movie, given the movie id.


My Movies 1.0.0

Copyright Hirondelle Systems - Generated 2008Dec30.15.53