11.07.2015 Views

CS 47/147 Advanced Object-Oriented Programming - Caltech

CS 47/147 Advanced Object-Oriented Programming - Caltech

CS 47/147 Advanced Object-Oriented Programming - Caltech

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Book Example: File Systemcontents!File*FS<strong>Object</strong>entries*DirEntry+name!!Dir?*parent (~children)• The contents of a DirEntry is either aFile or a Dir.– In other words: e.contents ∈ File ∪ Dir• Union of File and Dir is another set,FS<strong>Object</strong>.– File and Dir are subsets.– They are disjoint (shared arrow).– Their union is the entire superset (filledarrowhead).– They are static: object belongs to sameone for entire lifetime (double line onleft).• Note constraints:– DirEntrys are immutable.(Neither name nor contents changes.)– A DirEntry refers to exactly 1 FS<strong>Object</strong>.– Many DirEntrys can refer to sameobject.Name17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!