
rooneg at electricjellyfish
Jun 5, 2005, 11:48 AM
Post #1 of 3
(3789 views)
Permalink
|
The current interface exposed by Lucene4c requires the user to pass in a path when a directory is needed, as opposed to using an actual directory object. Advantage: Less code to write, no need to create yet another object when you want to access a local directory. Disavantage: No way to use something other than what amounts to an FSDirectory under the hood. Now most of the time what you want is an FSDirectory, but there's nothing that requires that to be the case, and other directory implementations do exist in the Java code that we could wrap, not to mention the fact that we could provide our own interface for implementing one in C. Since C doesn't let you have multiple versions of a function with the same name and different arguments, if we want to allow the user to use both paths and directory objects that means two versions of every function that takes a directory, with slightly different names, which I don't particularly like. I'm leaning towards going in and creating a directory object again (this is what the pre-GCJ version of Lucene4c did, and it seemed reasonable), and requiring people to create one before doing anything that requires a directory. This way we retain the ability to add more directory types in the future without screwing with the interface and without adding a ton of extra functions. Thoughts? -garrett
|