Lecture 12 - prototyping prt 2 Flashcards

1
Q

how do we implement a generic search on a collection?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

generic search for composite keys?

A

make sure each class involved implements SimpleKey. and search has , composite key is an interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is persistence?

A

saving data between sessions?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what persistence methods are used whilst prototyping?

A

ObjectOutputStream and ObjectInputStream - they allow us to write and read whole system object to file. (databases are used outside of prototyping)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how do we implement the persistence methods?

A

make all classes implement serializable. main class has to have 2 static methods to write and read system object to file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly