Package Structure
Each BlackBerry application should follow a standard package structure:
- com.mycompany.myproject
- event
- model
- service
- ui
- util
- widgets
- Application.java
- Settings.java
The event, model, service, and ui packages should have sub-packages based on the business model for the application.
- model - Contains business model objects. These are JavaBeans
which are specific to the business. They have properties and getters and setters for those properties. They are usually persistable (not serializable since the BlackBerry does not support it). It should use sub-packages similar to the com.iverticalleap.biz.service package of iverticalleap-biz project or the iverticalleap-model project. - service - Contains services and managers which perform business functions for the application. It should use the same sub-packages as model. Parsers and persistence providers should also be under the appropriate sub-package of the service package. UID.java should be under the service package.
- event - Contains events which connect the UI and services. It should use the same sub-packages as model.
- ui - Contains the ui elements (screens, containers, and tabs) of the application. It should use the same sub-packages as model.
- util - Contains utility classes. This should not be used for most projects as something should either be a service/manager for business functionality or a utility in one of our library projects.
- widgets - Contains reusable widgets. The widgets package should use sub-packages which mirror the org-metova-bb-widgets project.
