由于JVM虚拟机对对象的销毁,程序员是不知道的;而且手机的配置肯定不如PC机,就算PC机里程序运行得多顺畅,手机里的运行速率还是不敢保证。
针对对象的问题,尽量将一次能创建的对象只创建一次:
比如中文都得这样写:
public static final String TRACE = "流程跟踪";//√ public static final String TITLE = "标题:";//√ public static final String DRAFTER ="拟稿人:";//√ public static final String DRAFTERTIME ="拟稿日期:";//√ public static final String DRAFTERSEPT ="拟稿部门:";//√ public static final String URGENCYLEVEL ="紧急程度:";//√ public static final String CONTACTPHONE ="联系电话:";//√ public static final String ATTMENT ="附件:";//√ public static final String CONTEXT = "正文附件"; public static final String BIZZTYPE ="业务类型:";//√ public static final String ANNOUNCEMENTTYPE ="公告类型:";//√ public static final String OPTION = "公司领导意见";//√ public static final String ADVICE = "审批意见";//√ public static final String TRANSELECT = "路径选择:";//√ public static final String BACKTODRAFTER = "退回拟稿人";//√ public static final String PUBSEPT ="发布范围:";//√ public static final String SUBMIT = "提交";//√ public static final String SUBMITDETAIL = "您确定提交以上信息吗?";//√\ public static final String MESSAGE = "请填写审批意见"; public static final String SEGMENT = "环节:"; public static final String DEALER = "处理人:"; public static final String LATERSEGMENT = "后续环节:"; public static final String RECEIVEMESSAGE = "请选择接收人";
比如一些设置样式的,尽量不要每次用都创建set一下,比如:
panelStyle.setStyle("title-text-style", "color=#1e3275 padding=5");//文字颜色
应该这样写比较合适:
businessName.setClass("textDetailStyle"); titleName.setClass("textDetailStyle"); drafterName.setClass("textDetailStyle"); telephone.setClass("textDetailStyle"); drafteTime.setClass("textDetailStyle"); drafteDepart.setClass("textDetailStyle"); emergencyLevel.setClass("textDetailStyle"); noticeType.setClass("textDetailStyle");
时间: 2024-09-09 14:10:00