Hi Jukka

Jukka Zitting schrieb:
Hi,

On Tue, Jan 19, 2010 at 1:45 PM, Johannes Koch
<[email protected]> wrote:
Jukka Zitting schrieb:
I'm not a big fan of the COSObjectable mechanism as it breaks the
layers of abstraction.

Is there some other way we could achieve the same functionality?
What is the functionality you want to achieve?

I was referring to your request about PDFBox objects giving access to
the underlying dictionary. Could we rather solve such cases with more
task-specific methods that wouldn't expose the object internals?

I don't think the COSObjectable interface with its public getCOSObject is necessary. But I would like to have one object wrapping the dictionary (giving protected access via getCOSDictionary()), so more specific PD objects could extend it.

An example of the problem such direct access causes are the various
memorized values we've recently added to avoid the performance hit of
repeatedly looking things up from the underlying directory maps. The
correctness of such code depends on the dictionary not being modified
by external code.

Do you mean more specific PD objects should have member properties for faster access to the values instead of recreating them with each access?
E.g. PDStructureElement would get

private PDPage page;

for faster access, initialized with a PDPage object created from the "Pg" entry in the dictionary. Of course, this PDPage object has to be updated if the underlying dictionary entry changes. How?

--
Johannes Koch
Fraunhofer Institute for Applied Information Technology FIT
Web Compliance Center
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142628    Fax: +49-2241-142065

Reply via email to