티스토리 뷰
※ tutorialspoint의 OOAD 요약 (https://www.tutorialspoints.com/object_oriented_analysis_design/)
1. Class
3개 section을 갖는 rectangle로 표현,
- top section: class name
- moddle section: class attribute
- bottom section: class operation
attribute, operation의 visibility는 다음과 방법으로 표현,
-
Public: 시스템 어디에서나 visible. symbol prefix '+' 사용.
- Private: class 내에서만 visible. class외부에서 접근 불가능. symbol prefix '-' 사용.
- Protected: class 내부와 상속받은 subclass에서만 visible. class 외부에서 접근 불가능. symbol prefix '#' 사용.
abstract class는 italic으로 class name 작성.
Example: Circle class. Circle class의 attribute는 x-coord, y-coord, radius. operation는 findArea(), findCircumference(). x-coord, y-coord가 private이고, radius가 protected, member function은 public이라고 가정.
2. Object
2개 section의 rectangle로 표현,
-
top section: class name / package와 함께 object name 표현. name form,
-
object-name: class-name
-
object-name: class-name :: package-name
-
class-name: anonymous object인 경우
-
-
bottom section: attribute의 value. form은 attribute-name = value.
-
종종 rounded rectangle로 표현하기도 함
Example: Circle class의 object c1. c1의 center는 (2, 3), radius는 5라고 가정.
3. Component
일련의 interface의 실체화를 준수 / 제공하는 시스템의 물리적, 교체 가능한 부분. class, interface 등의 element의 물리적 패키징 표현.
Notation: tab을 갖는 rectangle로 표현
4. Interface
class, component method의 모음. class, component에 의해 제공되는 service set 지정.
Notation: name을 갖는 circle로 표현. class, component와 함께 표현.
5. Package
element로 구성된 그룹. class, component, 다른 package와 같은 structural thing 포함.
Notation: tabbed folder로 표현. name으로만 표현하지만, package detail을 포함할 수 있음.
6. Relationship
다양한 relationship 표현,
Usually, relatiionship element는 특정 role을 가짐. role name은 특정 context의 element behavior 의미.
Example: 아래 그림은 class간의 다른 relationship 표현. 첫번째는 association으로, Department는 여러 Employee를 가짐. Worker는 role name. Department 옆의 '1'과 Employee 옆의 '*'은 one-to-many 표현. 두번째는 aggregation으로 University is "whole-of" many Departments 의미.