国航OA项目技术总结(二)关于JVM虚拟机中对象的创建,手机端提速的重要优化

由于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");
		





上一篇:如何监控mysql主从之间的延迟


下一篇:DigitalRealty公司在达拉斯新建一个数据中心