I reuse a handful of classes for multiple projects, like Postal Address, State, Zip Code and Phone Number. Associated to them maybe parse/format classes (like Phone Number Formatting).
Is it okay to have a JAR with only a couple of classes? An alternative would be to have one “Miscellaneous” JAR with all the classes however it feels dirty to have so few classes for different purposes within the same JAR.
postal.jar
Address
Zip
ZipParser
ZipFormatter
State
phonenumber.jar
PhoneNumber
PhoneNumberFormatter
PhoneNumberParser
One jar (with 8 classes) or two (with 5/3 split)?
It’s okay to do it in any way that makes sense for your project(s). However, I guess I would ask the question:
Do you think that you will ever use address without phone number or vice versa on your projects?
To me, those items go pretty hand in hand. Even if you aren’t using both right away in some context you could need it soon in the future. I think a jar called something like contact-info.jar makes perfect sense.