문제

When developing J2EE web applications I would typically organise my package structure in the following way

com.jameselsey.<applicationName>.

  1. Controller - Controllers/Actions go here
  2. Service - transactional service classes, called by Controllers
  3. Domain - My domain classes/objects that the application uses
  4. DAO - abstract DAO layer
  5. DAOImpl - implementing DAO layer, to make JPA/JDO/Hibernate switchable etc
  6. Utils - utility classes, anything generic I might want to use such as my own DateUtils etc

This allows me to keep my classes organised in locations specific to their roles/tasks.

Is there an equivalent for Android? I haven't been able to find any guidelines as yet, I'm looking for an adopted standard of package heirarchy/structuring

Thanks

도움이 되었습니까?

해결책

If you are using a DI framework yes they tend to name them that way..but both DI and MVC are somewhat new to Android and not a lot of devs are using those naming patterns.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top