UML : Association relationship

จากหัวข้อที่แล้ว

UML : Dependency relationship

มาวันนี้ก็จะกลับมาต่อกันอีกอันนะครับ นั่นก็คือ Association relationship

an association is a relationship between two classifiers, such as  classes or use cases, that describes the reasons for the relationship and the rules that govern the relationship.

 

แปลได้ความว่า Association เป็น relation ที่เกิดขึ้นระหว่าง Class 2 Class เพื่อให้ต่างฝ่ายสามารถที่จะใช้ attribute หรือ operation ของอีก class ได้

Example

จากตัวอย่างจะเห็นได้ว่า Class Student นั้นมี Association Relationship กับ Class Course

จะเห็นว่ามีเลข 1 ที่หัวและหางระหว่าง Association เวลาอ่านความสำพันธ์ก็ง่ายๆ ครับ คือ

ถ้าอ่านจาก Student ไปหา Course ก็ให้เอามือเนี้ย..ปิดตัวเลข 1 ที่อยู่ใกล้ Student มันก็จะออ่านได้ว่า

Class Student นั้นสามารถมี Course ได้เพียง 1 Course

แต่ถ้าอ่านจาก Course ไปหา Student ก็จะอ่านได้ว่า

Class Course นั้นสามารถมี Student ได้เพียง 1 คนนั่นเอง (ดูไม่สมเหตุสมผลเท่าไหร่..เนาะ)

ส่วนไอ้ Class Environment ที่มี เส้นประวิ่งเข้าไปเกาะ กับ Association relation นั้น เราจะเรียกไอ้เส้นประนั้นว่า

 

Association Classes, an association class is a class that is part of an association relationship between two other classes.

 

ก็คือ relation ที่วิ่งเข้ามาเกาะกับ Class 2 Classes ที่มีความสำพันธ์แบบ Association relationship นั่นเอง โดย Class Environment นั้นจะมีหน้าที่ Provide ข้อมูลเช่น section, grade, semester ให้กับ Association relationship (เส้นทึบนั่นเอง)

From :

http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r0m0/index.jsp?topic=/com.ibm.xtools.modeler.doc/topics/cdepend.html

http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r0m0/index.jsp?topic=/com.ibm.xtools.modeler.doc/topics/cassn.html

Related Posts

This entry was posted in UML and tagged . Bookmark the permalink.

One Response to UML : Association relationship

  1. Pingback: UML : Directed Association Relationship | STORY of AODDY.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">