[SW Engineering] 4.4. Guideline for Creating Class Diagram

이상윤·2024년 4월 21일
0

소프트웨어공학

목록 보기
7/11
  • 클래스를 명시할 때는 주로 명사를 사용한다.
  • Attribute 값은 주로 형용사로 나타낸다.
  • Operation은 주로 동사로 나타내진다.

예제

다음 조건을 만족하는 University Information System의 Class Diagram을 작성해보자.

  • A university consists of multiple faculties which are composed of various institutes. Each faculty and each institute has a name. An address is known for each institute.
    (대학은 다양한 기관들로 구성된 복수의 학부들로 구성된다. 각 학부과 각 연구소는 이름을 가지고 있다. 각 연구소마다 주소가 알려져 있다.)

  • Each faculty is led by a dean, who is an employee of the university.
    (각 학부는 대학의 직원인 학장이 이끈다.)

  • The total number of employees is known. Employees have a social security number, a name, and an email address. There is a distinction between research and administrative personnel.
    (전체 직원 수는 알려져 있다. 직원들은 주민등록번호, 이름, 이메일 주소를 가지고 있다. 연구 인력과 행정 인력은 구분이 있다.)

  • Research associates are assigned to at least one institute. The field of study of each research associate is known. Furthermore, research associates can be involved in projects for a certain number of hours, and the name, starting date, and end date of the projects are known. Some research associates hold courses. Then they are called lecturers.
    (적어도 하나의 연구소에는 연구회원이 배치되어 있다. 각 연구회원의 연구 분야는 알려져 있다. 나아가 연구회원은 일정 시간 동안 프로젝트에 참여할 수 있으며 프로젝트의 이름, 시작일, 종료일 등이 알려져 있다. 일부 연구회원은 강좌를 개최하기도 한다. 그런 다음 이들을 강사라고 부른다.)

  • Courses have a unique number (ID), a name, and a weekly duration in hours.
    (과정에는 고유 번호(ID), 이름 및 주간 지속 시간(시간)이 있다.)

  1. Class 찾기
    faculty, institute, employee, administrative employee, research associate, project, course, lecturer
    이때, dean(학장)의 경우 자격, 즉 role 특성에 나타날 정보이고, employee와 비교해 특별히 추가된 특성은 없으니 따로 명세하지 않는다.
    university의 경우 모델링의 대상이 되는 단어이기때문에 따로 명세하지 않는다.
  2. Attribute 찾기
    • faculty: name
    • instityte: name, address
    • employee: social security number(SSNo), name, email address
    • research associate: field of study
    • project: name, starting date, end date
    • course: id, name, weekly duration in hours
  3. 관계 파악
    • research associate, administrative employee -> INHERIT employee:{abstract}
    • lecturer -> (INHERITANCE) research associate
    • institute 1...* -<> 1 (COMPOSITION) faculty
      (faculty가 institute 포함. faculty가 없으면 institute도 없음. 여러 Institute는 단 하나의 Faculty에 포함됨)
    • Employee (role:dean) 1 -(leads)-> 0..1 Faculty
      (한명의 employee가 dean의 역할으로 faculty를 이끈다. employee중 일부만 faculty를 이끄니 0 or 1이다.)
    • Employee 1..* -(work for)-> 1 Faculty
      (다수의 employee들은 하나의 faculty에 속해서 일한다. 아래 그림에서 생략됨)
    • research associate 1..* -<> (COMPOSITION) 1 institude
      (다수의 research associate들은 단 하나의 institude에 포함된다. institude가 없으면 research associate도 없다.)
    • reserach associate 1.. -(participate)- 0.. project
      (이때, 각 participate마다 certain number of hours만큼 일한다고 명시했으니, 이를 포함한 participation이라는 Association Class를 만드는게 좋겠다.)
    • lecturer -> (INHERITANCE) research associate
    • lecturer 1.. -(teaches->)- 1.. course

0개의 댓글

관련 채용 정보