"Contract" feature

1 view
Skip to first unread message

Joel

unread,
Aug 9, 2011, 2:40:56 AM8/9/11
to BrailleUtils
Hi all,

I have committed the "contract" feature that I started working on this
spring without further modifications. I did this because:
1. I don't remember what was missing, so I can't make it better right
now anyway
2. I will not be able to work on it for a very long time and perhaps
it can be useful as a starting point

It should not break anything since the method I added to the
EmbosserWriter interface has been implemented in
AbstractEmbosserWriter and all implementations except
FileToDeviceEmbosserWriter extends this class.

The purpose of this feature is to enable an EmbosserWriter
implementation to tweak the communication with the embosser based on
the contents of the EmbosserWriter communication. This has the effect
that choices which require knowledge that a user cannot be expected to
have can be automatic and hidden. The purpose is therefore also to
avoid exposing a set of choices where some choices are predictably
invalid to the user.

To make use of this feature:
1. Modify the Embosser implementation's newEmbosserWriter methods
wrapping the currently returned EmbosserWriter object in a
BufferedEmbosserWriter and return this object
2. Modify the original EmbosserWriter implementation to make use of
the information passed to it from BufferedEmbosserWriter by overriding
the open(boolean duplex, Contract contract) method.

Since I never finished this feature, I would encourage you to test it
extensively. Also, there might be other information that can be added
to the Contract, feel free to elaborate. ;)

Best,
Joel

Bert Frees

unread,
Aug 9, 2011, 5:22:13 AM8/9/11
to braill...@googlegroups.com
Hello Joel,

Thank you for making this code available. It is pretty much what I
expected. I don't think odt2braille will use the feature in the next
release, because there's not much time, and 8-dot is not properly
supported yet anyway. But it will be a good starting point for the
planned work on true 8-dot support.

Bert

Reply all
Reply to author
Forward
0 new messages