I am working on a shopping cart application for Android. While creating package design, I can think of 2 options
Design 1. Divide packages based on role like
com.shoppingcart.activity //all activity classes
com.shoppingcart.utility //all utility classes
com.shoppingcart.database //all database handlers
etc
or
Design 2. Divide based on component
com.shoppingcart.login
com.shoppingcart.searchproduct
com.shoppingcart.order
Which of the 2 designs will be better?
Option 1 is better, because java package name is a design time concept not runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With