서비스 파트 소개
EGL 서비스 파트는 여러 시작점이 있는 프로그램과 유사합니다.
예제는 다음과 같습니다.
Service MyService{}
// variables and constants can be here
function calculate(myScore INT[]) returns (BIN (4,2))
numberOfScores, i, mySum INT;
numberOfScores = myScore.getSize();
for (i from 1 to numberOfScores by 1)
mySum = myScore[i] + mySum;
end
return(mySum/numberOfScores);
end
// other functions are here
end
함수 calculate는 정수의 배열을 수신한 후 평균을 계산하여 리턴합니다. 서비스는 서비스 요청자가 여러 함수를 사용할 수 있게 할 수 있습니다.
세부사항은 "서비스: 최상위 레벨 개요" 및 해당 하위 주제를 참조하십시오.