CS 47/147 Advanced Object-Oriented Programming - Caltech
CS 47/147 Advanced Object-Oriented Programming - Caltech
CS 47/147 Advanced Object-Oriented Programming - Caltech
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
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