Search code examples
javaapiclass-library

When to implement and use a class library?


I have been developing a software for Android. The feature I am currently developing will use a set of classes that perform calculations used to define the geometric profile of a thread.

These classes don't necessarily have anything to do with the program and could be useful in other programs. They will only describe a thread and perform only the calculations necessary for that task. Ideally they will be suitable for myself and others to use without actually knowing how the classes and functions are implemented.

How do I define what I am describing? How would I implement this concept in Java?

Thanks


Solution

  • You would put these reusable classes in a separate project, in their own specific package, and generate a jar from these classes. This jar could then be put in the classpath of any other project that needs to use these classes.

    Make sure to document these classes and how to use them, so that all the projects using them know how to do it.