How to organize code logically into package while preserving encapsulation
问题 This is a conceptual question. I usually organize code in packages logically. E.g.: math operation goes in my.package.math or business logic goes into my.package.business and so on. In these days I have a doubt that I want to share about a constraint imposed by the package visibility in java. Let me show some code to explain better my case: I have the following package structure: +-- org.example +-- greetings | +-- RandomGreetings +-- GreetingsService | +-- Main and the following code: