| |
| |
Flyweight - Ajax Patterns |
 | | Because these Flyweight objects don’t have internal, object-specific, state, we have to pass a little context each time. |
 | | Flyweight often rears its head when you have some kind of object pooling (e.g. |
 | | Unlike Java-style Flyweights, we don’t have to declare abstract methods though; JS being dynamic, we can rely on Duck Typing, so it’s possible that our ManualComment and our TrackbackComment will each have their own markAsSpam() method, but Comment (if it exists at all), will have no such thing. |
| ajaxpatterns.org /Flyweight (447 words) |
|