IS /是否有任何Android的标准封装结构/层次的做法? [英] Is/Are there any standard package structuring/hierarchy practices for Android?

查看:186
本文介绍了IS /是否有任何Android的标准封装结构/层次的做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发J2EE Web应用程序我通常会安排我的包结构通过以下方式

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

com.jameselsey< applicationName的方式>


  1. 控制器 - 控制器/行动去这里

  2. 服务 - 事务服务类,由控制器名为

  3. - 我的领域类/对象的应用程序使用

  4. DAO - 抽象DAO层

  5. DAOImpl - 实现DAO层,使JPA / JDO / Hibernate的切换等

  6. utils的 - 实用工具类,通用的东西我可能要使用比如我自己DateUtils等

  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.

有没有为Android等效?我一直没能找到任何指引,然而,我在找包层次结构/结构的采用的标准

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

感谢

推荐答案

如果您使用的是DI框架,是的,他们往往会说出他们way..but DI和MVC两者都有些新的Andr​​oid版并没有很多的开发者正在使用这些命名模式。

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.

这篇关于IS /是否有任何Android的标准封装结构/层次的做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆