Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6832507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:52:01+00:00 2026-05-26T22:52:01+00:00

So I was looking at Google’s I/O App, iosched, and I notice they implement

  • 0

So I was looking at Google’s I/O App, iosched, and I notice they implement constants through a nested interface. For example in their ScheduleDatabase class they have:

public class ScheduleDatabase extends SQLiteOpenHelper {
    interface Tables {
        String BLOCKS = "blocks"
        String TRACKS = "tracks"
    }
}

But I have been reading online that it is poor java practice to create a interface to just store constants. But as you can see in the ScheduleDatabase class it kind of makes sense why they went with this approach. So I was wondering if this is also poor practice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:52:02+00:00Added an answer on May 26, 2026 at 10:52 pm

    I think this is a coding style issue which is a matter of debate. On one hand you could argue that interfaces are for defining a contract between classes and these constants aren’t really part of that contract (they’re data), on the other you could argue that the encapsulation of these constants into a namespace is a good thing and organizes the code better.

    I can’t really say for sure whether this pattern is good or bad. If you have only a few constants then I’d say definitely don’t use it, but if you have a bunch of constants which you can logically organize into groups then you could consider it. Certainly I’m more comfortable with the nested interface version of this pattern over the regular interface version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been looking through Google search results for ways to implement some sort of
I am looking at google calendar and wondering how they did their reminders. Currently
I'm looking at Google App Engine Django on google code but the latest release
I am looking into using Google App Engine for a project and would like
I have been looking through Google and SO for something that could help me
I'm looking at Google App Engine's new task queue API for Java and I'm
Looking through google and stackoverflow, I found a number of questions asking about Failed
So I have been looking at Google Maps and they have the feature of
Looking at Google's code for their bookmark bubble library, I came across this: var
I'm new to jquery and I'm looking at google's code to create their 'More'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.