봉봉의 개인 블로그

2017-07-17-E(UML기호 정리) 본문

학원에서 배운것들/TEA - E

2017-07-17-E(UML기호 정리)

봉봉이네 2017. 7. 17. 10:02

UML기호를 정리


1.Class

-클래스를 나타냅니다

-기호

Class Name

+Attribute1 : Object

#Attribute2 : int

-Attribute 3 : String

+Operation1() : void

#Operation2() : int

-Operation3(str : String) : String

-소스

1
2
3
4
5
6
7
8
9
10
11
class ClassName{
    public Object Attribute1;
    protected int Attribute2;
    private String Attribute3;
 
    public void Operation1(){
    }
    protected int Operation2(){
    }
    private Operation3(String str){
    }
cs


2.Generalization(일반화, 상속)

-상속을 받은 객체를 표시한다.

-기호

Parents



Child



-소스

1
2
3
4
5
6
class Parents{
...
}
class Child extends Parents{
...
}
cs


3.  Realization(실체화,구현)

-인터페이스를 구현한다.

-기호

Interface



Class



-소스

1
2
3
4
5
6
interface Interface{
...
}
class Class implements Interface{
...
}
cs


4.Dependency(의존,파라미터,리턴 값등)

-의존적인 성격을 가지고 있는 파라미터, 리턴값 등에 사용할 경우 표시한다. COntract에서 변화가 생기면

Phone에서 코드의 변화를 줘야한다.

Phone


+call(contract : Contract) : void

Call()

Contract



-소스

1
2
3
4
5
6
7
8
class Contract{
...
}
class Phone{
    public void call(Contract contract){
    ...
    }
}
cs


5.Association(연관)

-관계를 나타낼때 사용

-기호

AssociationClass



use

Constant

+STR : String


-소스

1
2
3
4
5
class AssociationClass{
    public void test(){
        Constant.STR;
    }
}
cs


6.Directed Association (직접연관)

-직접적으로 해당 클래스를 변수로써 사용함, person 객체가 있어도 되고 없어도 된다.

-기호

Car

-person : Person


Person



-소스

1
2
3
4
5
6
class Person{
...
}
class Car{
    private Person person;
}
cs


7.Aggregation(집합,집합연관)

-해당클래스를 직접 생성하지는 않고 인스턴스를 받아서 사용한다.

-기호

Car

-fuel : Fuel

+Car(fuel : Fuel)

Fuel



-소스

1
2
3
4
5
6
7
8
9
class Fuel{
...
}
class Car{
    private Fuel fuel;
    public Car(Fuel fuel){
        this.fuel = fuel;
    }
}
cs


8.Composition(합성 , 합성 연관)

-클래스를 직접 인스턴스로 생성하여 사용한다.

-기호

Car

-mEngine : Engine

+Car()

Engine



-소스

1
2
3
4
5
6
7
8
9
class Engine{
...
}
class Car{
    private Engine mEngine;
    public Car(){
        mEngine = new Engine();
    }
}
cs


9.InnerClass(이너 클래스)

-클래스 내부에 클래스를 정의한다.

Phone



Contact



-소스

1
2
3
4
5
6
class Phone{
    ...
    class Contact{
        ...
    }
}
cs


'학원에서 배운것들 > TEA - E' 카테고리의 다른 글

2017-07-25-E(Spring AOP)  (0) 2017.07.25
2017-07-24-E(Spring Security)  (0) 2017.07.24
2017-07-05-schema(스키마)  (0) 2017.07.05
2017-07-04-개발 방법론  (0) 2017.07.04
2017-07-03-Java Annotations(어노테이션)  (0) 2017.07.03
Comments