|
|
|||||||
|
While the pattern does reduce object creation it is not always as applicable as this article implies. For instance the line drawing example has a huge issue. It can not repaint itself after a blur. The data to paint it is not stored anywhere. The heavy weight version could be readily modified to be re-drawable. The swing tree node example that displayed the file system does work well, because the state is stored in the file system. If the re-fetch of the data was more expensive (like database or web service) then it would be necessary to maintain sufficient state to repaint. The article is concise though! |