Closed jeluard closed 11 years ago
Absolutely, I agree journal creation is pretty ugly right now. A pull request would be great :)
Sorry for the late late reply :(
I'm not sure about the need to extend Journal: what about a "JournalBuilder" that just builds and opens/returns a Journal?
Sure. I extended Journal as a way to embed the builder class in the Journal (but in Journal.IO it would be in Journal itself). Having the builder external to the Journal seems very fine too.
Cool, do you maybe have some time to make such changes?
Now the builder is in a dedicated JournalBuilder
class. I didn't change the visibility of Journal
constructor for backward compatibility but it would probably be cleaner to change it to private at some point.
Great, I'll have a look!
Currently it's not always easy to distinguish between what must be set on a Journal from what is optional. Also the Journal lifecycle is not enforced and calling read/write before open leads to error that might be hard to diagnose if a library does not own the Journal creation.
I am considering working on a light builder implementation to generate a fully configured Journal.
Would that make sense to integrate that in the main codebase?