Lecture 12 - prototyping prt 2 Flashcards
how do we implement a generic search on a collection?
define an interface (public interface SimpleKey) which contains abstract method getKey. Another method - (public static ) method takes collection and key to seach. iterates through and returns result
generic search for composite keys?
make sure each class involved implements SimpleKey. and search has , composite key is an interface
what is persistence?
saving data between sessions?
what persistence methods are used whilst prototyping?
ObjectOutputStream and ObjectInputStream - they allow us to write and read whole system object to file. (databases are used outside of prototyping)
how do we implement the persistence methods?
make all classes implement serializable. main class has to have 2 static methods to write and read system object to file.