COMP 303 Lecture 5: COMP 303 05 Good Practices Sep 29, 2016
Document Summary
Abstraction simulating something as a general quality/characteristic that"s authentic to what"s happening, apart from concrete realities. Designing abstractions to simulate a real artifact in code must consider: A: the computer must have at least two cores, to allow for two threads, b/c the saving-to-queue thread can"t be waiting for the saving-to-disk thread. Array: slowest. deleting items -> have to shift everything. List: medium speed pro: nearly in nite space (limited by ram) What"s wrong with this? changing bu er from array to list means that we"d have to change main() in 3 places. To make a well formed program, we want to make how the bu er is stored private. A class whose instance cannot be modi ed. (good for multithreading, can pass it anywhere and not worry about whether it"s been changed. ) Immutable in java are: string, int, bool, etc