반응형

 

기본 01. 클래스 특징

@startuml
abstract        abstract
abstract class  "abstract class"
annotation      annotation
circle          circle
()              circle_short_form
class           class
class           class_stereo  <<stereotype>>
diamond         diamond
<>              diamond_short_form
entity          entity
enum            enum
exception       exception
interface       interface
metaclass       metaclass
protocol        protocol
stereotype      stereotype
struct          struct
@enduml

 

 

 

 

기본 02. 클래스 관계

클래스 관계는 다음과 같은 부호를 사용합니다.

유형 기호 목적
확장 <|-- 계층 구조에서 클래스의 특수화
구현 <|.. 클래스에 의한 인터페이스의 실현
컴포지션 *-- 부분이 전체 없이는 존재할 수 없음
집합 o-- 부분이 전체와 독립적으로 존재할 수 있음
의존성 --> 객체가 다른 객체를 사용함
약한 의존성 ..> 더 약한 형태의 의존성

--  .. 점선으로 대체 가능합니다.이러한 규칙들로 다음과 같은 다이어그램을 그리는 것이 가능합니다.

 

기본 03. 클래스 관계 표시

 

기본 04. 관계를 나타내기 위한 레이블

 

기본 05. 클래스 필드, 메서드 나타내기

 

아래와 같이, {feild}와 {method}를 이용해서 명시적으로 나타낼 수도 있다.

기본 06. 메소드, 필드 가시화(Visibility) 정의

메소드나 필드들을 정의할 때, 특수문자를 사용하여 관련된 아이템을 가시화할 수 있습니다. 명령어는 다음과 같습니다:

 

 

 

skinparam classAttributeIconSize 0를 사용하여, 아이콘 표시를 끌 수 있습니다. 명령어는 다음과 같습니다:

 

 

기본 07. 필드, 메서드에 노트 표시하기

@startuml
class A {
{static} int counter
+void {abstract} start(int timeout)
}
note right of A::counter
  This member is annotated
end note
note right of A::start
  This method is now explained in a UML note
end note
@enduml

반응형