|
|
|||||||
|
Small mistake in "Figure 7. A component node adapter.". Mistake is in the far right side Post It Note, where it says: " public boolean isLeaf() { return component.getComponentCount() > 0; } " This is wrong. You can see that isLeaf() wouldn't return true when it really was a leaf. Checking the article confirms this: the author's Java code is correct, but his UML class model is an accidental fudge of these two methods from the Java code: public boolean isLeaf() { return !isContainer(); } public boolean isContainer() { return getComponent().getComponentCount() > 0; } Great article though. Nice practical example of Adapter. In general, excellent UML use.
|