[daisy] Programmatically create a link (VariantKey)
Bruno Dumon
bruno at outerthought.org
Wed Dec 6 03:50:38 CST 2006
On Tue, 2006-12-05 at 09:31 -0500, Robert Cecil wrote:
> Awesome help guys. I had stumbled onto the bare constructor, and
> frankly, I was unsure of myself.
As long as you stick to the APIs, you can do anything you want. The API
contains mostly interfaces, but if there are any concrete classes in
there, you're free to use them.
> I was unsure because my previous experience with the API seemed to
> follow more of factory-method approach for lifecycle
> (createDocument(), etc, etc.)
Yep, but that's because the implementation of those objects is hidden.
The VariantKey is as simple value object (like a string), so can be
instantiated as is.
> Have you thought about making a factory method on VariantManager or
> DocumentManager called
>
>
> createDefaultVariant(Document doc)
Might make sense indeed, though I'd rather add it as a static method on
the VariantKey object. Or we could at least define the -1 as a constant
somewhere.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org bruno at apache.org
More information about the daisy
mailing list