문제

I can see in dom4j library a number of classes with Flyweight prefix: FlyweightAttribute, FlyweightComment, FlyweightText etc. Here is what java doc is saying in the case of FlyweightText:

FlyweightText is a Flyweight pattern implementation of a singly linked, read-only XML Text. This node could be shared across documents and elements though it does not support the parent relationship.

However, I can't seem to find in the code instance pool nor where these instances are shared between documents.

Is this feature implemented at all in the library? If yes, where is the code that implements it?

도움이 되었습니까?

해결책

I've just looked through the sources of 1.6.1. Looks like these Flyweight classes are just peaces of original ideas. At least they are not flyweights in the GoF sense (I don't see any method requires extrinsic state as an argument).

Why don't you ask James Strachan (jstrachan@apache.org) who is the author of these classes?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top