trait JournalEntryFactory {
def createJournalEntry():JournalEntry
def initializeJournalEntry(context:TransactionContexts,journalEntry:JournalEntry)
}
The factory now is responsible for creating and initializing a journal entry.
In the kernel, we have the following code in the processTransaction method:
val journalEntry = journalEntryFactory.createJournalEntry()
transactionContexts.addJournalEntry(journalEntry)
journalEntryFactory.initializeJournalEntry(transactionContexts,journalEntry)
journalEntry.eval(transactionContexts)
A typical invocation of kernel.processTransaction would now look like this:
kernel.processTransaction(new SomeJournalEntryFactory(UIContext))
where UIContext supplies the journal entry factory with the particulars of a user request.
I'll check this code in once I've reworked the kernel root element test.