question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reorganization of collections: use inner classes to associate related objects

See original GitHub issue

Currently, 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:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
borislincommented, Jul 12, 2018

@lintool Jackson uses class definitions of Status and WashingtonPost to parse (deserialize & serialize) a tweet JSON and a WashingtonPost JSON data respectively. How about naming them TweetObject and WashingtonPostObject?

0reactions
lintoolcommented, Jul 16, 2018

Yay, we’re all done. Thanks @borislin !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found