Reorganization of collections: use inner classes to associate related objects
See original GitHub issueCurrently, we have FooCollection
and FooDocument
, like ClueWeb09Collection
and ClueWeb09Document
. Since they are a tightly-bound semantic unit, one could reorganize as inner classes. So:
ClueWeb09
would be the name of the collection (implicitly)ClueWeb09.Document
would be the name of the document from that class.
Same with all the other collections. Then we can reorganize all these bundles in io.anserini.collection.lib
; the interface definitions go in io.anserini.collection
.
This would also make Javadocs a lot cleaner.
The only major downside I can see is that our source code files will be much longer… but given that one navigates with an IDE these days, it’s not that big a deal…?
Thoughts @Peilin-Yang?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Collections and Inner Classes - Objects and Java Seminar
Inner classes have a reference to an enclosing instance. A common use for inner classes is to define event handler "call backs." Nested...
Read more >Nested Classes in Java - GeeksforGeeks
In Java, it is possible to define a class within another class, such classes are known as nested classes. They enable you to...
Read more >java - Instantiating inner class - Stack Overflow
I think you want to declare the HashPerson class as static . Otherwise it can only be instantiated in the context of the...
Read more >Working with Interfaces and Inner Classes in Java - InformIT
Inner Classes. An inner class is a class that is defined inside another class. Why would you want to do that? There are...
Read more >Nested Classes - Learning the Java Language
As with instance methods and variables, an inner class is associated with an instance of its enclosing class and has direct access to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lintool Jackson uses class definitions of
Status
andWashingtonPost
to parse (deserialize & serialize) a tweet JSON and a WashingtonPost JSON data respectively. How about naming themTweetObject
andWashingtonPostObject
?Yay, we’re all done. Thanks @borislin !