jacson logo courtesy from Doris & Frank.Developer Information > Design Decisions2005-10-04 00:11:20 v0.90
Jacson, say Jackson, think J-Scan

Design Decisions

What is Jacson?
Getting started
How it works?
How to Contribute?
Developer Information
  How to Extend?
  Quality assurance
  Design Decisions
Other information

Well, of course there were a few. :-) Mentioned here are the hard ones. Not to forget that some of my collegues might call me cunctator when I'm out.

Distributing reports and states to subhandlers

In Jacson many classes have to forward information to other classes which have been registered. The information are mainly
  • chunks
  • JacsonState
  • JacsonReport
the current API for forwarding this information is for example JacsonChunkDrain:
void putChunk(JacsonState, JacsonReport, String)
void summary(JacsonReport)
This API would allow very dynamic changing of states and reports at runtime. On the other hand it requires the JVM to pass additional parameters many times (for large jobs) per chunk. An alternative way to approach the problem would be to register the JacsonState and JacsonReport separately from passing the chunks. This would mean overhead in the case we'd need to change JacsonStates and -Reports in the middle of a job (which is actually not the case when you have a XML based hierarchy), and look like:
void setState(JacsonState)
void setReport(JacsonReport)
void putChunk(String)
void summary()
I'll most likely rework Jacson in one of the next releases to the latter more appropiate and more time efficient layout (at the cost of a slightly larger API and slightly more internal storage used by the internal Jacson classes).

Push or pull?

My first approach chunks were passed in a pull fashion: Filters pulled chunks from the source. Evaluations pulled it from the Filters. But then it looked that a push is much easier: Chunks are generated in the Source and pushed into the Filter queue and then in the Evaluations. The advantage of pushing chunks is, that they can easily be multiplied and forwarded to different destinations where they are treated differently. This did not seem easyly to accomplish with a pull (like Java InputStreams).

What is a chunk?

The one I'm still most undecided with is the modellation of a chunk. Two ways, either a special object or a plain String.
  • pro String
    • one object per chunk, reduce garbage for large runs.
    • definition how regular expressions and string functions work is obvious.
    • definition of identity unclear (for example for accounting).
  • pro Chunk
    • better transport of information (like line numbers).
    • more oo-conform.
    • possibilty to invent totally new usages.

NewsfeedRSS feed
FilefeedRSS feed
Sourceforge Logo