COMP 303 Lecture 5: COMP 303 05 Good Practices Sep 29, 2016

25 views3 pages

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

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers