Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is better package Design? [closed]

Tags:

android

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?

like image 408
Kamal Avatar asked Feb 14 '12 06:02

Kamal


1 Answers

Option 1 is better, because java package name is a design time concept not runtime.

like image 113
Rajdeep Dua Avatar answered Oct 11 '22 16:10

Rajdeep Dua