[소프트웨어 공학] 3. UML Class Diagram

 

 

Object

 

  • Class 는 붕어빵을 만드는 틀이고, Object는 실제 붕어빵들이다.
  • maxMiller가 Person이란 Class Object의 이름이다. 
  • :Person처럼 때론 익명의 Object를 바로 만들어 바로 사용할 수 있다.
  • Objects are instances of classes

 

Class

 

  • Arrtibutes : Java로 따지면 필드
  • Operations : Java로 따지면 Method
  • 같은 클래스 타입의 객체라면 Attributes는 다른 값을 가질 수 있지만 , 행위 (Operation)은 같다.

 

Class Variable and Class Operation

 

 

  • Class variable (= class attribute, static attribute) : 클래스당 하나만 정의된다. 모든 클래스의 인스턴스로부터 공유된다.
  • Class operation (= static operation) : static 형의 공유되는 메소드
  •  # 는 Protected, +는 Public , -는 Private
  • Class variable 또는 Class operation은 밑줄이 있다.

 

Abstract Operations and Classes

 

  • body가 없는 operation이다.
  • <-> Concrete Operations and Classes
  • 추상 클래스는 인스텐스를 만들수 없다.
  • Abstract operation이 하나라도 포함한다면 Abstract Class다. (역은 참이아님)
  • Abstract operation이 없어도 Abstract Class일 수 있다. 

 

  •  <<abstract>>으로 표기하거나 {abstract} property를 준다. 
  • 이름이 기울어진 글씨체라면 abstract class이다. 

 

Interfaces

 

  • UML interface는 abstract operation의 집합이다.
  • Provided interfaces : 클래스 또는 컴포넌트로부터 실현된, 구현된 인터페이스를 말한다. (일반적 생각하는 인터페이스)
  • Required interfaces : 클래스 또는 컴포넌트로부터 공급을 받아야 하는 인터페이스 이다. ( 클래스안에 인터페이스 에 관한게 쓰인 경우)
  • 노란색이 Provided , 파란색이 Required 인터페이스 임.

 

 

Types of class relationship

 

 

 

Dependency

 

 

 

Association

+ Recent posts