Which is better package design?

I am working on an Android shopping app. When creating a package design, I can present 2 options

Design 1. Separate packages based on role, for example

com.shoppingcart.activity //all activity classes

com.shoppingcart.utility //all utility classes

com.shoppingcart.database //all database handlers

etc.

or

Construction 2. Split based on component

com.shoppingcart.login

com.shoppingcart.searchproduct

com.shoppingcart.order

Which of the two options would be better?

+5
source share
1 answer

Option 1 is better because the java package name is a concept of development time, not runtime.

+6
source

All Articles