read.pudn.comread.pudn.com/downloads160/ebook/720957/8.uml.pdfFungsi Implementation View Programmer...

Preview:

Citation preview

1

���������������� ��� ������������������ ��� ������������������ ��� ������������������ ��� ��

�����������

� � ��� ��� ��������������� ��

� ������� ����� ��

� ��������� ����� ��

� ������������ �� ��������� �!����"

� #���� !����

� $� ��� �����!�� ������

� �������%�!�� ������

������ ��� !�����!����� ���!����� ���

���� ��� �� � ���� ��

2

� #����

� ��� ������� ������������

� � ��������� %��� ����� �� ������ ��� ����� ��

� ������� ����� &�' �$ �(�� ����� � �� ��)�*

� #���� + +

� ������� ��!� � ������� �� � !�� ��� ���� ����� ���

������

� ��������!���� + + ����������

� ��,� �� ��� ���������� �� %� �� ��� ����

� )��������-��.# ��!��� ����� ����������,����

� /������� !�� ����������.#�� ��,� � ��� ���

����� ��� ����!���� !�����

���� ��� �� � ���� ��

����������������� �������

� �������� ��!���!������� ���� ��� %����������

��� ���� ����"�!�� !�� ����!��� ����� � �!�����

��������������� ����!�������

� �� !���� !�������� ��!� ��� �������

� 0����� ����!�������� !���� ��� �� ��� ����

� ��������� ����� ����� !���� �� ��

������

� ������� ����-

� #���� ������� ��� ����

� ������ ������������ ����� ��� ����

� )��!����� ��������� !�������������� ����

� /������ ��� ���� ������

3

����� � 12.��� �� ���� ��3������� �� ��� !����+ + #� &��% -������� � � ��

4 5+ �,%��+ ����!�#������ �� ������%�����36�&�,�� ���0�� � ����3�17718

� 9�� ���� -�� � �4 5+ �,%��+ ����!� �!�������!�#����36�)����%�� ���3�17718

� �-������ ���������� ��� ��������4 5+ �,%��+ ����!������ ���0������%����36�)����%�� ���3�17::8

� ;�%�����-�� ��������������� � ����������4 5+ �,%��+ ����!������ ������������-���< ��0���#�����������% 36��!!�����= �� 3�177>8

��� � ���� ����

�)� ��� !���� + + #�� ���,����

� 0��� ��-������ ����� � ��

4 5+ �,%��+ ����!�#����� ���� ? �������� � �!36�

)����%�� ���3�177@8

� ���� ��-����� ����� � ��� � ���

4 5�!������+ + ������ ��-�? �#� ��� � �!�� �� �)�����������

)������36�)= �3�177A8

� ' �� � �-�!������"� ����

4 5#�����)������-���� �������9������+ �,%��+ ����!�

����� ��36��!!�����= �� 3�17728

� &��% ��!�9�� ���� -�� � #�"���������

4 5<����!� � �!�����+ �,%��+ ����!�#����� ��36�9��������

?93�1772

��� � ���� ����

4

�� �������� ����������������� � �� �!��� !����

!�� ������� + + � ����������� !���� ;���

�)� ����� �� &��% 3�9�� ���� 3�!�� ;�%������

� ����

� ����� < �����B

� ?�,� ��,��� < �

� )� �!��� ����������!�� !������

4 #������ �< ��0��

4 #������ �0����

4 #������ �)������

4 #������ �$�������

4 #������ �$� ��� �����

���� � � ���

�< ���!��� �� ��� ����� ����������3������������3�

����������!�� !���� ������� ������

����� ��

�� � ���������

5

�)� ����� �� &��% !�� 9�� ���� � 177@

�C���D8:�!��������� + ����� 1772

�$��� ;�%������!�� + �,%��� !�������� � �,�!�

9����������!� �����1772

�< ��>8D�E ������� � � !���� ��� �����!���

�< ��182�E ��������� � � � ������

��� � ����

��������� ������������������

Konseptual Fisik

Logical View

End-user Fungsi

Implementation View

Programmer Manajemen software

Process View

PerformansiSkalabilitasThroughput

Integrator Sistem

Deployment View

Topologi SistemDelivery, instalasi

Komunikasi

Rekayasa Sistem

Use Case View

6

����� � � ���

Booch method OMT

Unified Method 0.8OOPSLA ´95

OOSEOtherMethods

UML 0.9Web - June ´96

publicfeedback

Final submission to OMG, Sep ‘97

First submission to OMG, Jan ´97UML 1.1

OMG Acceptance, Nov 1997

UML 1.3

UML 1.0UML partners

UML 2.0!

UML 1.5

Meyer

Before and after conditions

Harel

StatechartsGamma, et al

Frameworks and patterns,

HP Fusion

Operation descriptions and message numbering

Embley

Singleton classes andhigh-level view

Wirfs-Brock

Responsibilities

Odell

Classification

Shlaer - Mellor

Object lifecycles

Rumbaugh

OMT

Booch

Booch method

Jacobson

OOSE

��������� ���

7

�#������ �< ��0��

�#������ �0�����!�� + � �

�#������ �)������

� #������ �����% ���

� #������ ��%�����

�#������ �$�������

� �F��%�#������

� 0�������������#������

�#������ �$� ��� �����

� 0�� ������#������

� #��� � ���#������

���� ���� � �� �� ������� � ���

� ����� ������ � �� �� � ���� � !������

"����� � �� � ����� ��� �� �

Use CaseDiagramsUse Case

DiagramsUse CaseDiagrams

ScenarioDiagramsScenario

DiagramsCollaborationDiagrams

StateDiagramsState

DiagramsComponentDiagrams

ComponentDiagramsComponent

DiagramsDeploymentDiagrams

StateDiagramsState

DiagramsObjectDiagrams

ScenarioDiagramsScenario

DiagramsStatechartDiagrams

Use CaseDiagramsUse Case

DiagramsSequenceDiagrams

StateDiagramsState

DiagramsClassDiagrams

ActivityDiagrams

Model

8

Pemodelan Use Case

Agenda

������ ���%������B

�/�������� < ��0��

�<��0������8�!���� � ����� ��

� � ������ � �!��< ��0��

� � ���

� �����

� < ��0��

� 9����< ��0��

�0����

9

Apakah Use Case itu?

�#����� �� $��� ;�%�������177@"

�5���%����!��� ������ ���������!����������!� ����� 6

� ����� ������ �)�� ��������� �5&��%��&�G6"�������� !����������� ���

����� ����� ������� ����� �,�!����� �������,��� ���

� �!�����%���&< /�( ������ �� �!��������������� � ������,���� �� ���

Keuntungan Use Case

� ������� ����� �� ����������!����������� ���

� � ���!��������,��� !�� �������� !������ ����

� ����� � !�������� �����

� #���� � � ����� �� �����

� � !����� �� �� ���� ����� � ��%�� ����� ��

����������� !���� %�����������!�� ������!����

�����

� &���������������������� ���

� <�������%��!���!����

� ����� ��%�� ��� ����!���%������ !�� !��!�����

!���� ������ !���� ���%��� �������� !��!������%���

��%�� ��

10

Use Case vs. Kebutuhan

� #���� � ����� �� � � ������ ��� ����� ����� � !�������� ����� 8�< ��%���� ����� ������ ���� ����!�������� ����!�� �����!��������

� < ��%��������� � !�������� ����� � �������������� ��

� /���� �� ��� ����� !�!���� �������� ���������%��� ��� ���� !���� ���%����

� ��� � �!� ����� ����!��������� �!�� ����� ������������

� � ������ �������� � ���������

� )������� � � ������ %����

Diagram Use Case pada UML

� �!�����%���!���� ������ !���� < ������������ ���� ��� !������ ����%���

�?�!���� @��� � ���� �-� ��� �$

� �% � ����������������!� �����

� � ������������ ����� �������!�� ��!� �����

� &����� ����� �� �

11

Sistem� &����� !����� �!��� ���%��3�� ������� !�������������

���� ������ �����

� ����� ��!�� ���� ���� ����� ����� ��

� �!��������� ������� �����

� &����� � ��� �������� ���� !�� ������ � ��� ����� �����B

� &����� � ��� ����!�������� �� ����� ����B

4 /����� �� ������ ����!���� ������ !�� ������� !���� ������� �����

4 #���� !�������� �%��� ����� ����

� ����� !������������� �����������

� (�� � ����� � ��%��!���� � ���� !�!���� �����

Traffic Violations Report System

Aktor� ������� ���� ������ ��������������!���� �����

���������� ������ ���!���� �����

� ����� � ������� ������ ����!�� ������ !���� ����� 3������ ������!���!� !��������

� 0���� -� 0����E ���������� !���

� ����������E � ���,����� � �!��������� �� ���� !���

� ������E � ���,����� � �� �� ���������

� ���� ����!���� ������ ��� !������� ������

� ����� ��!�� ���� � ������� &��� ����� ����� ������� ������ ������� !����

���� ������ �����

� ����� � � ��� ����� � ����� � ������ ������

� < ��%���!�������� �� �����

12

Icon Aktor

Clerk

<< Actor >>Clerk

Relasi antar Aktor� &��� ������ ����� �!��� ������ !���������3�,��� ������ ������

����!�����������3�!���� ������ ����������������

� )������ ������ ������!���� ������ !���� ����� �����%����

� ����� ������������ � ������������ �����%�����!�� � ��� �� ���

������ %���

� 9��������� ����� ��!�� ����� !��������

ClerkSupervisorManager

13

Identifikasi Aktor

� ����� ����� ������� ���������� � !���� ����� B

� ����� ����� � ������ � �������3��!� ���������!��� �,������� ����� B

� #���� ����� ��� ��!� �������� ����� ��� ��������� ����������B� ����� ��� ���� ����

� �������������!������ ���� ������� � �� ����� �%���������"

Use Case� � ������ ������������ ����!�������� �����

� <��%���� � �� ���,��� �����

� ����� !�������� �� �����

� < ��%���� �� ������� ������ �����

� < ��%���������� ;����� � � �������%���� !���� ���%��� ������� �%��

����� ���� ��� �������� ���%���������!��� ����������������"

� ������� ���%��������� � !���� ������ �%��� �������� �����������!� ��� !�� �������� ������ ������ ��� �����

!�� ����� ����������

� <��%���� ����� ������ �� ����

� ����� ������ !�� ��� ��������!�� ����� ������ &��� !�����������!�� � ������ !����3������� � ����

�� ������� !���� ����� � ��� ���

14

Menemukan Use Case

�<���� ����� ����� ��������� � �!�!���������-� ����� ��� ����!����� ��� ����� !��������

4 � ��%�3�� � ����3�� �� ����3�� � �!�������3�� � �� ��� ������ ���

� �������� ����!�������� �����B

� #������� ���,��� ����� !��������!��!� ������B4 ?�!�� ������������ �� � ��!� ����� ���� ���

Icon Use Case

� ������ ������������ � ���%��

� #��� ������ !���� ������� ����� ����!�� �!����

� &� ������� ���!��� � ���� ����� !���� ��� ���������������� /%��������� ���%������������� �� ��

Add Traffic Violation

Traffic Violations Report system

Clerk

15

Relasi Use Case

� 9����'��� �� �������� ��

� &��� �,�� �� ���%���� � ��� ��������� �� �� 3��������

���!���� !�� �!���� !���� ���� ���%��� ����!��������

�� ���%�������

� H�II���%��!��JJ�K�� � ������ �� � � ����� ����

!�������� H������ � �������� K����!��� � ���� ����

� &����� ������!��� ����������������

� <��%�����%��!� ���� ������

� H� ���� � � �� ����!����� ��!���K������

� � ������ �

<< include >>X Y

Relasi Use Case

� 9����( �����������

� #�������� ���� �,�� �� ���%���� ������� ����������3������

� ������� ��� � � ��� �����!��� ������!�� � ������

!�������� !���� ���� ���%��

� ' ���������!�� ��������������%��� ���� � � ��� ����,���

������� �

� <��%��������������� � ������ ������� ��������� !������

%�������������

� ' ������������%��� ���� ������

� <��%��������������!���� �� ������� !���� ����� ����

� <��%��������������� ��� �� ��� ���!����� ��!�� �� ��

��� ����� �(#"

Specialized Generalized

16

Relasi Use Case

�9�����) ���� ���� !���� ��������������������!���� ��������� �� �� !�!���� � �

� <��%�������������� �� � �) �������%�������������

� <��%������ �� �� ���� !�!���������� �%����������� ��� �� ��� �

<< extend >>(5: confirmation)

New OffenderAdd T.R.

(5: confirmation)

Rekomendasi Alur Kerja

18 $!�������������� �!�� ������ � ,��� !��������"

>8 <���� ����� �����3��!������������%������ ���

��!�� �!� ���%��� �������������

�8 ?������ ��,��� �����

�8 )������� ������� ���� � ����� � �!������� ��,���

%8 &��� ���%�������� ����� ��,���

E ��������,��� ���� �� �������� !��� ����

!8 C���!������ ������ ���%��� �����!�

L8 ' �� ������ !������ ����%��

17

Contoh – Traffic Violation Report System (TVRS)

Remove T.V

Lookup T.V

Replace Offender

New Offender

Edit T.V.(8)

Add T.V.(9)

Clerk

Supervisor

Traffic Violations Report System

<<extend>>

<<extend>>

<<include>> OffendersDB

PolicemenDB

#���$������� ����

HTSSHTSS

Scan Items

Ring Order

Buy Items CustomerCashier

CatalogCatalog

Check Status

Place Order

Fill Order

Estb. Credit

Customer

Sales Person

Supervisor

HTSS: System View

Catalog: Class View

18

#���$������� ����

#���$�� � ��������%�&

� '�� � �� � ���*�*����$ ���% %���$ ���� � � ���*�� +��%����� ���� �� ��

$ �� �� ��% $ � �%��,�� �� ������$ ���$ +�� �������� ���*�%�

�� �+���,�� �� ������� � - ����$ ���$ +�� ��� ��*��� %� ����$

� ���*,�+�� �� $ �����$ �%%�� ��� ��*��� � � $ ���$ +�� %� ����

��� ��*������"�� ��*��� *��������� �� ��+� �� %� � �� �����

19

���� �� ����# ��

"� ���# �������' ����("#�)�* +������,

�Dokter menentukan resep untuk pasien

�Dokter memberikan informasi obat: nama obat, takaran, jumlah dos danrefill

�Komputer melakukan cross-ce antaraobat dan sejarah obat/medis yang sudah ada

�Resep dikirim secara elektronik keapotik atau dicetak untuk pasien

+

#���$�"� ���# ��

20

� ��� �

&����� !������ ����%�������� ������C0#

�� �� # ��

21

�����

�?�,���

������ ������� %��������B

�?�� ������� %����� 0�����&���!��

� 0����������

� 0�����0������

� �%���������� %����

�0����

!��� �

�$!������������ ����� ���!�!�� ���������"�%����� ���������� !�������� ������������ ����!���� ������ !���� ���%��� )������ ������ !������%��� ���� !�!������������� �������� %����

� /���� �� ����������������!�� !�� �������

� /�����������!� � �%���������� !�� �����%����

22

�� � ��� ����# �������

�?���� � �%���%������ ��������� ����

�������� �����

� &������ ������ ����� !�� �����

� $����� ��� ����!�������� �����

� ������ �������!��������

�� � ��� ����# �������

<<boundary>>

<<entity>>

<<control>>

=

=

=

Stereotype yang mendefinisikanelemen model baru dalamhubungandengan elemenmodel lain

23

!����� ����# ��

<<boundary>>

<<boundary>>

<<entity>>

<<control>>

<<entity>>

<<boundary>>

Actor1

Actor2

Model interaksiantara sistem danlingkungan

Menyimpan danmengaturinformasi dalamsistem

Koordinasiperilaku use case

# ���-��� �&

� � �!���� �������������� ����� !�� ���,��� �����!� !�!���� � �� 0��� ����������%

4 &�������������!� ������ ������ ����!������� � ���

4 ?�!�� ��������������!� ����������%��%��� !����

4 0����

E C���������#�����

� 0������ ��� ���#��%�������%�

4 /�����������!� ����������� ���� ���� !�!���������8�?�!����������������!� ������ ��� ��������!��� ��� ��������

� ���������� %���������!�� ���������� ��!�-� <���������%

� /�� ���������������

24

# ���.����&

� � �!���� ����� ���� � !��������

�&����� � ������ ���� �!��������� ��������

�&���������� ����� �� %� �� � ����� �����

�?�!�� ��������� ��!� ����������

�#���� !�������� ��� �� ���%��

# ���#���

� ��������!�� � ������!�������� ������� ���%��

� �!�������� ���,��� !������%���� %����� 0�����%�������� � ����� � %��������������� � ���,����

������ !�� ��!�� ���� � ���,���� ������ �%������������� ������ %�����%������

� 0����������!�%���!������� �� ��������������%��

� 0�����%������ ������� �������� %���������!�� �!������

� ������3���!���� ���� %�����%������������ ���� ���%��

� ?�������� ��!� ���%���!�� ����������

� 0���� -� C���������0��������

25

���' ���� ����# ��

18 <���� ����� ���%��-

�8 ?������ !����������%��

�8 $!���������%���������!�� 3����� �����������

%8 <���� ����� %������!������������

4 �������

4 9����

>8 C���!���� �!�3������������ ,��� ����

/�������� ��# ��

�0������ ������ ���� ��� �!���� -

� #���� � ����� ��

� �!�����%��

� )�� ������ ���� ��!�

� #�� ������� ����� ��

� #���� �������� �

26

/�������� ��# ��

� 0���������!�� � ���!��� � ��!���� ���� %���������!�� ������ ����� ����� ��

�������� ���%��

� 0�����%������� &����� �3���!���� ���� %�����%�������������%��

� ;��� �!� !�� %�����%����� �����,���3����%��� ������ ������� ���� !�������4 0���� -��5� �����������%������6�� ���������� ���%���

5!����!!��� ���������%������6

� 0���������� � #��!���������!���� � ��������� ���� ��!� !�� ����� ����

��!� ����� � ����� ������ ��� ����� ��3�!���� ������ ��3����%���!�� !���� ���������

� /��� ��!� �����-4 + � �

4 #�������������� � ��������"

4 �����

4 &���� ���� ����� �

.���� �� � � -���

� 0�����!�������

� )��!��� �� � ��!� ��� � -�5� ��� 63�5?C9�6888

� 0����� ������!�� �� �������

� 0����� ������!�� � ���,���� ������ !���� ����� �������"-�5����%� �!F������6888

� ������� ��������

� &����� ���� ��!� �����,��� !�� �!���� ������������� ����������!�����!� ������%����-�5$#63�5��� 63�59�����������6888

� ������

� &����� ���� ��!� �������� � ����������� ������� !�����!�������%����

4 0���� -�5?�% �������������6�!�� 5���!��6�� ������ � � ��� �������� �������!� !���%�����5)����6�

� /��� ��!� �������

� 5�!����������! ���� ��������� ������!�� �!� �%��� �����6

� ;����� �� ������� !���� ������� %����3�������������������-��59F���63�5+ ������6

27

���' ���������# ��

�)���������� ������������ !���%����� ����!��!���������� $����� ��� �����!� ��!� %����

� ���� ��

�/��� ��!� ������!�� � �,�!�%����� $����� �������� ����� ���������� ����� ������

� $����� ��� �����%��� ���� !�� ������� �� �

���' ���� ��

� �������������� � �� ������� !���� ���� ��,����� ����� ���� ��,�� �����������-��G����3�����3�����!888

� ������������-�!����3�%����3�� �����888

� ��� �������-���������3�������3��������888

� /�� ������-� ��3��������3����������3�%������!888

� ����� �-�� ��������3�� ����!���3����!�����888

� ���� ������������� ������!�� �� ������� !������� ����� �� ��������

� �������������� � !��� ���� � ��������� !������ ���������

28

#���$��� �� # ���!0��

�#����� ���� ��!� !�������� �� !�� ���%���

?C9���/��!�!�� %��������� "-

Traffic report

Supervisor

Report lookup

Confirmation

TVRS

Offender Details Form

Traffic report addition

System

Offender

Policeman

Vehicle number

License number

Fault

Traffic policeman

Commander

Violation

ID

Password

Police headquarters

Shutdown

Date

Speed

Traffic Violation

Clerk

.���� �� # �������� �

Traffic report

Supervisor

Report lookup

Confirmation

TVRS

Offender Details Form

Traffic report addition

System

Offender

Policeman

Vehicle number

License number

Fault

Traffic policeman

Commander

Violation

ID

Password

Police headquarters

Shutdown

Date

Speed

Traffic Violation

Clerk

29

.���� �� # �������� �

Traffic report

Supervisor

Report lookup

Confirmation

TVRS

Offender Details Form

Traffic report addition

System

Offender

Policeman

Vehicle number

License number

Fault

Traffic policeman

Commander

Violation

ID

Password

Police headquarters

Shutdown

Date

Speed

Traffic Violation

Clerk Clerk danSupervisorDigantidengan User

.���� ��# ���& ������ ����% �

Traffic report

User

Report lookup

Confirmation

TVRS

Offender Details Form

Traffic report addition

Offender

Policeman

Vehicle number

License number

Traffic policeman

Commander

Violation

ID

Password

Police headquarters

Shutdown

Date

Speed

30

.���� ��# ���& ������ ����% �

Traffic report

User

Report lookup

Confirmation

TVRS

Offender Details Form

Traffic report addition

Offender

Policeman

Vehicle number

License number

Traffic policeman

Commander

Violation

ID

Password

Police headquarters

Shutdown

Date

Speed

.���� �� ������� � ��� ��

Traffic report

User

Report lookup

Confirmation

TVRS

Offender Details Form

Traffic report addition

Offender

Policeman

Vehicle number

License number

Traffic policeman

Commander

Violation

ID

Password

Shutdown

Date

Speed

31

.���� �� ������� � ��� ��

Traffic report

User

Report lookup

Confirmation

TVRS

Offender Details Form

Traffic report addition

Offender

Policeman

Vehicle number

License number

Traffic policeman

Commander

Violation

ID

Password

Shutdown

Date

Speed

.���� �� � � ���� ���� �

Traffic report

User

Confirmation

TVRS

Offender Details Form

Offender

Policeman

Traffic policeman

Violation

32

.���� �� � � ���� ���� �

Traffic report

User

Confirmation

TVRS

Offender Details Form

Offender

Policeman

Traffic policeman

Violation

� ?�����%������

� < ��

� ?C9�

� + ���!��#����������

� + ���!�

� )���%� ��

� ?�����%�����%� ��

� C��������

� M

# ���.����&�(� ��� )

Daftar yang tersisabiasanya berisi class yang bukan class entiti, seperti“Offender Details Form”. Class boundary dancontrol lebih mudahditemukan dengan analisause case secara langsung.

33

# ���-��� �&�

�9����#���������

�)���%� ��#���������

�������9��������

�0������ �����#�����

�+ ���!��#&)��G

�)���%� ��#&)��G

�888

database proxy merupakan API level tinggi danmembungkuskomunikasi danbahasapemrogramansecara detail

# ���#���

��!!9����0��������

�9� ��9����0��������

�������9����0��������

��!��9����0��������

���� ���%�����0��������

�888

34

�� ������ �� ��# ���/

id : longname : Stringrank : int

Policeman

<<abstract>>

TrafficPoliceman id : longdescription : String

TrafficReport

id : longdescription : String

Violation

name : Stringid : long

Offender1..* 1

reports of

1..*

issues1 *

occuredAt : Date

�� ������ �� ��# ���//

Violation

EditReportController<<control>>

Traf f icReport

Of fender Traf f icPoliceman

Clerk

ReportDetailsForm<<boundary>>

Conf irmationDialog<<boundary>>

PolicemanDBProxy<<boundary>>

OffendersDBProxy<<boundary>>

OffendersDB

PolicemenDB

1

1 1

1

1

35

�� �� ��# ��

�����

������ %��������B

�9������� ���!�� �������%��

�0���� !������ �%����

�)�%���

�0���� ��%���

�#������ ��� �

36

�0������!��� ��� ����� �� ����� �� � ����

� ��������� �������3�������3�� ��!3������!��

�� ����� ������� �

�0�����!�����������%��� ������ �����������

�����

� (�� � 0����3�������� )������!�� ������)����%

� )������3��������������3�������3��,��� � �!�������!��8

�#����� � ��� ������� 0����������� �� �����

����� �������� ���� ����,��� � ���� �����

� ���������� �������������� !�� �����

�� � �# �������

�9������� ��-�� ��������E ����� >�%�����,��� ������� ���� %����� ���� � ���� ��

������� %��������������� � ������� ���,���

� �������E ��������!�� ��� ���� %������ ���� ���� ����� %����

� ' ���������E ������� �� ������ ����� � ������ ���� %����

�!��� ����%���� !���%���������

� �������%�� � .��/���������� ���� �������

� ������� � ����!�������� ������� � � �

� .��0 ���� 0�����!�� �!� ������� ,�� �� ������� ���� ���� �����

�������"

� /������� ���� �������

� /��0�����������!���� ���� �������

�� ��������� �������'��&

37

#����� �� ��# ��

Window {abstract, author=Joe, status=tested}

+size: Area = (100,100)#visibility: Boolean = invisible+default-size: Rectangle#max-size: Rectangle-xptr: XWindow

+display()+hide()+create()-attachXWindow(xsin:Xwindow)

What do +, #, What do +, #, -- Represent?Represent?

+ Public+ Public# Protected# Protected

-- PrivatePrivate

Window

+size: Area = (100,100)+default-size: Rectangle

+display()+hide()+create()

ProvidingProvidingSpecialized ViewsSpecialized Views

1���� �� �� � ����� ��

#���$������� ����

Item

NonPItem PerishItem

DeliItem ProduceItemDiaryItem

Customer

GroceryOrder

1

*

DeliOrder

1

*

contains

38

#���$������� �������' � ��� �

#���$�� � ��������%�&

39

�� �� ��# ���"#�$�1 �� � ��� ���

PharmacyDB

AddRxRecFillRxRefillRxDeleteRxRec

MedicationMedicationNameConflictInfoCheckForConflictUpdateConflictInfo

1

RxRxNumPhysicanNamePatientNameMedicationNameDosageNumDosesNumRefillsRefillsLeftWriteRx

PatientRecPatientNamePatientSSNDateOfBirthInsurerPolicyNumetc...UpdateRecetc...

MedicalHistoryMedicationHistoryKnownAllergiesImmunizationsPregnancyDataetc...

1n

n

n

1

�� �� ��# ��

� �������

!����� �����

40

�� �� ��# ��

� '� ���� � �� �� ��# ��

�#������ �%�������� ��� ������� �������

�)�%������!���!��������� %�����!��

!������������ !�� !� �������� ���� ��� � ����

� )��� #��!�% �!���� ����� ����� �����������

� ����!�������� �� � � ���� )�%�������������

��!� )�%��������

� )���� �� ��,��� ������ ���� "�� � ������

����� �� �������� ���� "

� �!����� ����� ��������� ����� ��� ����

���� �� �����

�?����3���!�� �!� �� ������������������

!��!�% �!���� !������ �������� �

41

#���� '� ��

�� �� ����&��

�?�������!���!���� � �� ��� �����

� ����!�������� ������� !�� ������� �� �

�#������� ���� � !���� !�� �������

�?�,���-

� $���������������� !������ �

� ������� ����� ��

�#��� ������� �� ������3�!����� !��

�� ��� ���

42

���� ����� ���� ��� �

�#������

0����

�#������

�������

�� �� ����&��

� ������� $�����%�!�� ����

43

� ��� �

&����� !������ �%���������� ������C0#

��2���'���� �� �

44

�����

�#������ �$�������

������ �F��%�#������ B

�+ � �

� ����

�/������$����� ���

�0����

�� �� ��/���� ���

�&����� !������ ������ � ����� ������

������� ���� � ��!� ����� ����������

�� �

� &����� ���� !������ ��!� ������ �� � !����

������ ����� � �%������,���

�&����� � !�������� ��!� � �!��!�� ��� ���

%���!������������ � !���� ������ ���� �����

�� �

45

�� �� ��/���� ���

�?�,��� !������ ����������!��� -

� �!��������������� �� �

� ������ ����� � ����������� ��� ����� ����

%��"����,�

� C���������� � � !�����������%���!�!����� ��

%����� �����!�

� $!����������������� ,�� ���������!��

� � ������� � !���� %����

�� �� ��/���� ���

�)�!� < �3��!� >�� �%��

� 0�������������#������

4 )������ ��!� �������� ���������� �� �

� �F��%�#������

4 )������ ��!� ��������� ���� ��!� �� �

46

�� � ���2���'���� �� ������

� ����� ������ ������ ��� �� � ������

����������

�)������ ��!� ������ � ���� ����

�#���� � � �!���� �%��� �!� ��� ������

��,�3���%�������3�������3�������!��

���������

#�����2���'���� �� �

member:LibraryMember book:Book :Book

Copy

borrow(book)ok = mayBorrow()

[ok] borrow(member)setTaken(member)

47

#�����2���'���� �� �

member:LibraryMember book:Book :Book

Copy

borrow(book)ok = mayBorrow()

[ok] borrow(member)setTaken(member)

X-Axis (objects)

Y-A

xis (time)

ObjectLife Linemessage

Activation box

condition

��&��

� )��� ��� + � �-

� ������ -����� �������������� ���� �

� (�� � %������������� !���� !������ �%������%�����

������� �"

� &������� � ������� ,��� �� � !��%� ���� ,���

������ �� � !���� ��� ������� � �!� !����

!������

� ' ���� ����������� ����������"�� � ������

�� � !�������� ���� � ��������

myBirthdy:Date

48

��� �

� $������������� >��� � !������ ���������� ����!������� !������� �� � � �� � ��������� &����� � !��� ��� �������� !���� �������� �������� ����

�!� ���

� #���� ����� ���� ������!������ � ������������ ������ ��� �������3����� � �������� �������� �%�����������!���� ��� ����

4 /�� ������������ ����� �������� �� ��� ��3�M"

4 9� ���)��%!���0�����9 $3�0+ 9&�3�M"

� ;��� �� � ��,1 � ������ ���� � �� � �������,> 3� ���� ��!���� ������� ����� !�� �� � ������� /����������� ����������

� ��,> �!��� !��� �������!�����,1� ��,> �!��� !��� �����!�����,1 �� � �!������ ��"

� ��,1 !�� ��,> �!��� �� � ������� �

��� �

� )��� !���� ������ ���������� ������ ��������!���>��� �� )� �������� !�����!���!������ ���

� = ���� ����!����� ��� �� �� � ����� � ����� � � ��������� !�� ������ !���� ���������������

� )��� !�������%��� � ���� ���!���� ��� � ����� ����� � !�� ������ ��������������!���3�������"��� ��������

!�� �������

� ��� !����� � ��������� !������������������� ����� �!��� ��� �� ���� ����������

49

!������ �

� �% ������

�� �% ������

��� ��

0���

#����

<<create>>

<<destroy>>

��� ��&�'�����

����� ����� ������ �������3������� �

!��� ��� �������� �������� �������� ������

� 9���� ����� ����������� !�������������

�� ������� ������� ������

:A :B

doYouUnderstand()

Pemanggildi-blok

return (opsional)yes

50

3� � ������

�#�������� ��������!���� ���� ����������� ����!����������������� ;����� � � �!���� �����������,��� ��� ���!��� �������3�� ����� � ��?�����"

� �!���� ����������� �� � ,��� !�������� �����!��%� �� �� ��� ��������3�� ����� � ����������� ��� ����!��� ����� � ���� ��������

� ��� !����� � � �!���� �����������������������!���� � �!�����%�����3������ok = isValid()

����� � ���&��

�+ � � !���� � � ���� �� � ������ ���������<<create>>

:A :B

<<create>>

Constructor

:A

<<create>> :B

Preferred

51

����� ��� ����&��

� + � ��!������ �� ������� �������� �����������<<destroy>>� + � ��!������ �� �����!���� ����!���

� �� ��!����� � �!��������� ��������� ���%�����

� ���,� ��� � ����������

:A :B

<<destroy>>

��� ����&�'�����

� #���������������� � �!���������� � �����������

� )� ������� ������ ������������!�������������� �� ���,������������� ������,����� �� ������������������

� � ��� ���� � � ��� ���� ��!��������!���!������ ��������������������������������

� )������ �% �������!����� � ������ ��!�������!�������������������"

� � ������� ������

� /�� ��������!������ ��!� �����!������,����

52

/���� �������

�/��!���

� ������- NON�������PQP����������

� )����!������ � �� ��,�������!��������

� 0���� -

�$�����

� ������- R�O�NON�������NQP�Q����������

� #������ �������������� ������!�� ����������

�������� ������� ����� ���� ��

[ok] borrow(member)

/���� �������

�0���� �������-

:Driver

*[until full] insert()

:Bus

Sintak dari ekspresi bukan

standart

:CompoundShape :Shape

*draw()draw()

53

/���� �������

� ������ ���������!�����F��%�!������ � �� ��%������������� �!���������������!� ���� )����� � ������������!������ ����������������� �!���� ������� ���

� ;������� �����������F��%�!������ ��������� �!������������ ���%����!��������� ������� ���������������� ������� ! � ������� ����������� ���� "�#���

��2���'���� �� �

54

��2���'���� �� �

getViolation(id)

., ����4

Clerk

:ViolationsDialog

:ViolationsController

:ViolationsDBProxy

lookupviewButton()

id=getID()

v:TrafficViolation

display(v)

<<create>>

v

Lookup Traffic Violation

Bisa mengguna

kan pseudo code

DB di-query dan hasilnya dikembalikan sebagai obyek

55

print(doc,client)

., ����5

Client

:PrintServer :Queue :PrinterProxy

enqueue(job)

status

Printing A Document

job=dequeue()

[job]print(job.doc)

[job] done(status)

Repeated forever with 1 min interludes

Obyek Aktif

��2���'���� �� ��"#�

56

PharmacyDB

Rx Medication MedicalHistory

EnterRxInfo

CheckForConflictGetMedHistory

ConflictResults

PerformConflictChk

RxRecord

��2���'���� �� ��"#�

��2���'���� �� �������� ����

57

��2���'���� �� �������� ����

# �� ������ �� �

58

# �� ����� �� �

�0�������������#������ -�!�������!�������������

����������������� �

� ����������������!���� �� ������������

����"

# �� ������ �� �

59

# �� ������ �� �

� � �� ������������ ����� ��

�������F��% #������ �������

����������������� ��!�����!��

����

� ��������� ��������������

� ����� ���� ���3��0 ���3�!��8

# �� ������ �� �

Recommended