I have a class structure for handset and tablet elements: ProfileFragment(handset) and ProfileFragment(tablet) are derived from ProfileFragment(abstract).
Packages go like:
- fragments
- fragments.handset
- fragments.tablet
I’m not sure if I’m doing right with those potentially misleading duplicate class names. What would you recommend ?
You should always avoid naming multiple classes (which differ in their implementation) the same. Even though you can (using different packages).
You could go with putting the your device-type in the class name. E.g.
AbstractProfileFragmentTabletProfileFragmentHandsetProfileFragmentThose classes can (and should) still be split up into multiple packages.