-
Notifications
You must be signed in to change notification settings - Fork 2
Optimizing object size
Jinyoung Jang edited this page Dec 5, 2016
·
7 revisions
showDetails 참고값인 InstaceMonitorPanel 에서 얻고자 하는 세부적인 값은 instanceId 뿐이기 때문에 이를 Autowire 해서 가져올 때, InstaceMonitorPanel 내의 instanceId 의 값만 채워서 서버로 가져온다.
package com.abc.activitytype.view;
public class DataInputActivityView extends ActivityView {
@ServiceMethod(inContextMenu = true, target = ServiceMethod.TARGET_POPUP)//, where = "running")
public void showDetails(
@AutowiredFromClient(payload="instanceId") InstanceMonitorPanel instanceMonitorPanel,
@Payload("element")IElement element){
MetaworksRemoteService.wrapReturn(new ModalWindow(new Label("detail for " + getElement().getName() + " and the instanceId is " + instanceMonitorPanel.getInstanceId()), "title"));
}
}
예제는 Canvas 내에 포함된 Role 정의의 이름만을 참고해오기 위한 Selector 이다. 따라서 전체 Canvas 의 아주 일부 값만을 서버로 참고해 오는 것이 효율적이다. Canvas 의 내용을 가져올때 (Canvas 는 아주 무겁고 큰 데이터를 갖고 있다) Canvas의 프로퍼티인 elementViewList Array (혹은 List) 값 중에서 class가 RoleView 인것만 가져오는데, 그중에서도 가져온 RoleView 객체의 element.name 만 채워서 서버로 보낸다.
package org.uengine.kernel.face;
public class RoleSelectorFace extends SelectBox implements Face <Role>{
@AutowiredFromClient(
payload = "elementViewList[__className=='org.uengine.kernel.view.RoleView'].element.name"
)
public Canvas canvas;
...
@ServiceMethod(inContextMenu = true)
public void loadOptions(@Payload("selected") String selected){
setValueToFace(Role.forName(selected));
}
}
public Object showProperty(@AutowiredFromClient(payload = {"id", "elementViewList[true].element.name"})
Canvas canvas
)
@AutowiredFromClient(
payload = "elementViewList[__className=='com.abc.activitytype.view.DataInputActivityView' && toEdge==value.fromEdge].element.outValue.name"
) Canvas canvas,
혹은
@AutowiredFromClient(
payload = "elementViewList[value.fromEdge.indexOf(toEdge) > -1].element"
) Canvas canvas,