Interface Design
If you thought the preceding section was too easy you are correct - it is. If you follow the directions above you will be left with a perfect read-only interface that can safely be used for communication between modules, across threads, and even systems. If you want to do more please read this section on interface design, there are still some choices to be made.
- Publication — READ-ONLY
- Factory — create and read-only
- Visit — create, read-only, and visiting - giving us transformations
- Unsafe — READ-WRITE on the HONOUR SYSTEM
- Data Object — READ_WRITE with EQUALS
- Mutable — READ-WRITE with SYNCHRONIZATION and EVENTS
The above pages outline:
- A design requirement
- Example Implementation: to meet the requirement
- Implementation Alternatives: both good and bad
The example code is available in svn.
There is no Correct Answer
Please be aware that these are design options - is no correct answer. Please choose your solution based on your requirements/intentions.
If in doubt leave it out.
Labels