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

  • SEARCH
  • Home
  • 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 5945311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:39:49+00:00 2026-05-22T16:39:49+00:00

If I intend to create a set of API that will allow other developers

  • 0

If I intend to create a set of API that will allow other developers to interact with my application, how should I structure this set of API in the sense of packaging?

I am considering this…
For all the classes that runs my actual application, I have them in com.app.core
So for all features of my actual application, I have them in com.app.core.products, com.app.core.events, com.app.core.views, com.app.core.accounts, etc.

Then subsequently for the set of API classes, I put them in com.app.events, com.app.accounts, com.app.utils, etc.

Is this a good practise?

I’ve found this very weird in a few ways.
First, the core package is open to all. People can still access the core package objects directly, bypassing the API.

Second, I am having repetitive packages both in the ‘core’ package and in the outer package which serves as the API packages. For instance, com.app.core.accounts consists of all the classes the main application uses to operate its accounts module and com.app.accounts is an set of API classes for other developers to work from.

Third, if having repetitive packages is fine and is the right way to do so, then why wouldn’t I simply let anyone access directly to the com.app.core package and I don’t have repetitive folders and also the core package is accessible anyway?

What could have been a better way to do this? I working in Java and pretty new to this idea of creating my own API.

Thanks.

  • 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-22T16:39:49+00:00Added an answer on May 22, 2026 at 4:39 pm

    In my opinion those ‘repetitive’ packages are not a problem. They are just packages after all. The developer that works with your API only only sees them.

    Also it’s not necessarily a problem that the developer can access your implementation classes. It’s the same with Java itself: There are a lot of com.sun classes that can be used but that doesn’t mean that you should. It makes porting to another Java runtime difficult.

    It also depends a bit on the project. If you work with an architecture that cleanly separates the API from the implementation, the user of your API can’t access the implementation. OSGi and Web services come to mind. In this case you can create two different libraries: the implementation and the API with the implementation depending on the API. The API contains all classes that are important for external users. That way separation is quite easy.

    The third problem doesn’t really exist. You can have different libraries that provide classes for the same packages. As long as you control the namespace and don’t have duplicate classes in the same package everything is fine. A package is just a name, nothing else.

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

Sidebar

Related Questions

I intend to build a small web site that will poll a third party
The intent is to create a set of web services that people can reuse.
I intend to use RADIX / MTRIE as my preferred data-structure for a routing
I intend to develop a system that is entirely based on modules. The system
I intend to develop a small (Java) application for managing my finances. I believe
This is a question I intend to answer myself, but please feel free to
This problem pertains to Java By using RandomAccessFile I intend to be able to
My compilers class is creating a language that we intend to compile to Java
So I am still asking questions about this topic :-( So I create an
I am trying to design a table type structure that contains rows and cells.

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.