Mod03-Lec03 Planificacion Estrategica Para Fondos Ambientales
Lec03 2 Aggregation...
Transcript of Lec03 2 Aggregation...
![Page 1: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/1.jpg)
http://www.siam2dev.com [ dr. nattapong songneam]
โดย อ.ดร. นฐพงศ สงเนยมhttp://[email protected]
สาขาวชาวทยาการคอมพวเตอร และสาขาวชาเทคโนโลยสารสนเทศ
คณะวทยาศาสตรและเทคโนโลย มหาวทยาลยราชภฏพระนคร
Last Update : 28/11/2560
Lec03_2_Aggregation Abstraction
128/11/60
![Page 2: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/2.jpg)
สอบระหวางภาค
• ขอสอบเปนขอเขยน
• ประมาณ 5 -7 ขอใหญ
• 60 คะแนน คดเปน 20%
• เนอหาท สอบ บทท 1 , 2 , 3.1 , 3.2 , 3.3 , 3.4 , 4
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 2
![Page 3: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/3.jpg)
Final
• บทท 5 - 9
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 3
![Page 4: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/4.jpg)
ดร. นฐพงศ สงเนยม
• http://www.siam2dev.com• E-mail : [email protected]• Facebook : [email protected]
http://www.siam2dev.com [ dr. nattapong songneam] 428/11/60
![Page 5: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/5.jpg)
Lec03_2_Aggregation Abstraction
• ในบททแลวไดพดถง Classification Abstraction ไปแลว ซงเปนกระบวนการสราง Class จาก Object ตาง ๆ ทมอยใน Problem Domain จนได Class แตยงขาดความสมพนธระหวาง Class ตาง ๆ ทเราสรางขน
• จากสภาพความเปนจรงในโลกนจะพบวายงมวตถหลาย ๆ อยางทเกดจากการรวมตวของวตถอน ๆ เชน คนเกดจากการวมกนของ ลาตว แขน ขา หว หรอ คอมพวเตอรเกดจากการรวมของ case , main board , monitor , drive หรอแมแตโลกเรากยงประกอบไปดวย ดน นา อากาศ และแรธาต ตาง ๆ เปนตน
5http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 6: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/6.jpg)
Classification abstraction
คอการหาวาวตถ อยใหนคลาส การทจะบอกวาวตถใหนอย
ในคลาสใหน จะตองหาหรอสรปความคดรวบยอดเกยว
สงนนใหได
ความคดรวบยอดกคอ Concept Concept กคอการบอกวา วตถนนมลกษณะอะไรบาง
และมฟงกชนใดบาง เรยกสงนนวาอะไร
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 6
![Page 7: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/7.jpg)
ถา
• เจอ ปากกา ดนสอ เมาส โปรเจคเตอร อยในกลมเดยวกนหรอไม
– ถาไมอย
– ถาอย เรยกกวา อะไร
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 7
สงของ สงไมมชวต สนคา
•ไมมประโยชน
•มประโยชน
อปกรณคอมพวเตอรเครองเขยน
สงทอยในโลก
![Page 8: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/8.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 8
อปกรณคอมพวเตอรเครองเขยน
? เครองเขยน
ดนสอ
ปากกา
![Page 9: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/9.jpg)
• ถาเราเจอ สงหนง ท ส นน ราคา และใชเขยน เรยกวาปากกา
• ถาปากกาสแดง ไวบอรด ดนสอ ก อยในกลมน
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 9
ส
นน
ราคา
ใชเขยนได
ปากกา
ดนสอ
ไวบอรด
ปากกาสแดง
เมาส
![Page 10: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/10.jpg)
Reviews
• Objects ?
• Class ?
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 10
คน
Object / instance
class
Problem Domain = ขอบเขตระบบ/สงทเราสนใจ
![Page 11: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/11.jpg)
จะไดคลาสตางๆ fundamental classes
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 11
สมมมต ทา classification abs สาหรบ รพ.
สงทจะได กคอคลาสตางๆ ของ รพ.
หมอ พยาบาล ยา
ยาพารา
*** การเขยนแผนภาพคลาส class diagram สไมเกยว
เปนสมาชก
Is member of
![Page 12: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/12.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 12
ยา
ยาพาราเปนสมาชก
Is member of
-ชอ
-สรรพคณ
-เลขท
-วนเดอนป
+รกษาโรค
+กนได
attribute
?
![Page 13: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/13.jpg)
Reviews
• Objects ?
• Class ?
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 13
คน
Object / instance
class
Problem Domain = ขอบเขตระบบ/สงทเราสนใจ
คน
Object / instance
class ไมระบเจาะจง
เจาะจง นายก นาย ข คอ object
![Page 14: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/14.jpg)
ขนตอน การทา Classification Abs.ขนตอนท 1 : กาหนด Problem Domain
ขนตอนท 2 : หาคานาม
ขนตอนท 3 : แยกแยะ คานาม วา object หรอ attributes ของ
objects
ขนตอนท 4 : ให concept การใหความคดรวบยอด เพอใหได คลาส
พนฐานตางๆ
- วาดเปนแผนภาพเพอแสดง concept
ขนตอนท 5 : จากนน ระบ วาวตถใด อยในคลาสใด
ขนตอนท 6 : จากใสรายละเอยดของคลาส attribute , function
ขนตอนท 7 : วาดแผนภาพ แสดง classification abstractions28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 14
คอหาคลาสๆ จากวตถตางๆ
ทอยใน Problem domain
![Page 15: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/15.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 15
Classification abs.
Class A
Class B
Class C
Class E
Class N
Class A1
Class A2
Class A3
Aggregate
จะไดคลาสตางๆ รพ.
Class A
Class AClass A
Class D
Class B Class C
![Page 16: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/16.jpg)
วตถ ?
• หาคานาม• แลววาอะไรคอวตถ คอแอทรบวต• กาลงสนใจเรองอะไร ?
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 16
![Page 17: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/17.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 17
![Page 18: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/18.jpg)
18
รถยนต
รถไฟ
เรอ
เครองบน
ยานพาหนะ
โดยสารได
เคลอนทได
หยดได
เลยวได
ใชนามนหรอกาชเปนเชอเพลง
ความคดรวบยอด(Concept)ของยานพาหนะ
![Page 19: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/19.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 19
ยานพาหนะ
Is member of
เปนสมาชกของ
Classification abstractions
รถยนต รถไฟ เรอ เครองบน
![Page 20: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/20.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 20
รถยนต รถไฟ เรอ เครองบน
ยานพาหนะ
Is member of
เปนสมาชกของ
Classification abstractions
- ชอ
เคลอนทได()
class
objects
![Page 21: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/21.jpg)
21
HP
ASUS
ACER
IBM
คอมพวเตอร
มจอภาพ
แปนพมพ
ใชพลงงานไฟฟา
คานวณได
บนทกขอมลได
ความคดรวบยอดของคอมพวเตอร
![Page 22: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/22.jpg)
สวนประกอบ (Aggregate)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 22
![Page 23: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/23.jpg)
นาฬกาขอมอ มสวนประกอบอะไรบาง ?
• ถาน/แบตเตอร
• หนาปด
• สาย
• เขมนาฬกา หรอตวเลขท
บอกเวลา
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 23
![Page 24: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/24.jpg)
รถยนต มสวนประกอบอะไรบาง ?
• ลอ
• ไฟ
• กระจก
• เครองยนต
• พวงมาลย
• เบาะ
• ฯลฯ
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 24
รถ
ลอ
เปนสมาชกของ
![Page 25: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/25.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 25
![Page 26: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/26.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 26
ลอ
Classification Abstraction
class
objectobject
*** สามารถอธบายไดวา ไมวาจะเปนลอขางซาย และขางขวา จดวาเปนลอรถ นนเอง
ลอขางซาย ลอหนาลอขางขวา ลอหลง
Is member of/เปนสมาชกของ
![Page 27: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/27.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 27
ลอ
Is Part Of / เปนสวนหนง
Aggregation Abstraction
Class
ClassClass
ยางรถ แมก
*** สามารถอธบายไดวา ยางรถยนต ประกอบไปดวย ยางรถ และ แมก
![Page 28: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/28.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 28
ไฟหนา
กระโปรงรถ
ลอ ประต
กระจก
![Page 29: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/29.jpg)
สวนประกอบของคอมพวเตอร
รปจาก : http://gobgabsocool.blogspot.com/2013/03/blog-post.html 29http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 30: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/30.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 30
![Page 31: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/31.jpg)
หนวยความจา(RAM)หนวยประมวลผล(CPU)
ซาวนการด
จอภาพ(Monitor)
เมนบอรด(Mainboard)
คยบอรด(Keyboard)
คอมพวเตอร(Computer) เมาส(Mouse)
![Page 32: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/32.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 32
RAMIs member of / เปนสมาชกของ
Class
ObjectObject
DDR SD
![Page 33: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/33.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 33
Is member of / เปนสมาชกของ
Class
ObjectObject
DDR SD
VGA CardRAM
case
Main board
Is part of / เปนสวนหนง
![Page 34: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/34.jpg)
จงอธบาย คน ในเชงของ Aggregation Abstraction
• คน กประกอบไปดวย หว ลาตว แขน ขา ในขณะหวประกอบไปดวย ผม ตา ห จมก ปาก สมอง
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 34
• โรงพยาบาล• มหาวทยาลย• วด• รฐบาล
![Page 35: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/35.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 35
คน
Is Part Of / เปนสวนหนง
Aggregation Abstraction
Class
ClassClass
หว ลาตว
ปาก ตา เสนผม ห
![Page 36: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/36.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 36
![Page 37: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/37.jpg)
Keyboard
Ascii code :Message
A
buffer
มองการทางานระหวาง
แปนพมพและคอมพวเตอรเปน
แบบไคลเอน-เซรฟเวอร
37http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
A B
Client- Sever
![Page 38: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/38.jpg)
ตวอยาง 1
“หองเรยนประกอบไปดวย กระดานดา 1 กระดาน มเกาอและโตะจานวนหนง มนกศกษา มอาจารย”
จากขอความขางตน สามารถสรปไดวา class กระดานดา class โตะ class เกาอ class นกศกษา class อาจารย เมอนามารวมกนจะได class ใหม คอ class หองเรยน
38http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 39: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/39.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 39
![Page 40: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/40.jpg)
28/11/60
http://www.siam2dev.com [ dr. nattapong songneam] 40
หองคอม-หมายเลขหอง-อาจารย-นกศกษา-คอมพวเตอร-โตะคอมพวเตอร-แอร
-เปดได-ปดได-ใชเรยน/สอน
หอง 142
หอง 143
class
object
Is member of
หอง 144
หอง 144 เปนหองพก
อาจารย ไมสามารถใช
สอนคอมพวเตอรได
หอง 133
หอง 133 เปนหองเรยน
ธรรมดาไมมคอมพวเตอร
จงไมสามารถใชสอน
คอมพวเตอรได
-หมายเลขหอง-อาจารย-นกศกษา-คอมพวเตอร -โตะคอมพวเตอร -แอร
-เปดได-ปดได-ใชเรยน/สอน
![Page 41: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/41.jpg)
• Class– Button 1– Button 2– Button 3
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 41
ทกวตถจะตองม attributes และ function เหมอนกน - Text- Color
![Page 42: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/42.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 42
Button
Button- R Button-G
Button-B
Classification Abstraction
Is member of
![Page 43: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/43.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 43
Form
Button
Aggregate Abstraction
Title BarControl-box
Is part of
Button- R Button-G
Button-B
Is member of
![Page 44: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/44.jpg)
• Color attributes• Red value
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 44
![Page 45: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/45.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 45
-Name-Text-Color FORM
FORM-1
BUTTON
-Resizable()-Enabled()-Clickable()
BUTTON-1 : Button
-Text : Button-1- Color : Red-Name : Button1
-Text : Button-2- Color : Green-Name : Button2
-Text : Button-3- Color : Blue-Name : Button3
BUTTON-1 BUTTON-3
![Page 46: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/46.jpg)
• Class• Object
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 46
![Page 47: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/47.jpg)
หลกการ/แนวทาง
• ถาเรารวมคลาสยอยๆ เขาดวยกน ทาใหได ความคดรวบยอดใหม (concept) ได เราเรยกกระบวนการนวา Aggregation Abstraction
• หากรวมแลวไมเกด concept ใหมหรอไมได คลาสใหมทตางไปจากเดม กไมตองรวม
• นายก เปนนกเรยน (classification abstraction)
• นาย ข กเปนนกเรยน (classification abstraction)
47http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 48: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/48.jpg)
นายก เปนนกเรยน (classification abstraction)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 48
นกเรยน
นาย ก นาย ข
class
Object
![Page 49: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/49.jpg)
ใช abstaction ใดอธบาย
• คอมพวเตอรประกอบไปดวย mouse , keyboard ,monitor , case
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 49
คอมพวเตอร
keyboard mouse
Aggregation Abstraction
class
class
![Page 50: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/50.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 50
Computer
Keyboard Mouse
พมพได
ประมวลผลได
ใชไฟฟา
![Page 51: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/51.jpg)
สวนประกอบของหองเรยน
รปจาก :http://online.hcu.ac.th/joomla/index.php?view=detail&id=4&option=com_joomgallery&Itemid=5151http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 52: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/52.jpg)
หองเรยน
• Attribute– หมายเลขหอง– โตะ– เกาอ– อาจารย– นกเรยน
• Function– เปด– ปด– สอน– เรยน– บารงรกษา
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 52
![Page 53: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/53.jpg)
Attribute
PDT :: Primitive Data Type / ชนดขอมลพนฐาน- Integer- String- Character- Date/Time- ETC.
ADT :: Abstract Data Type / คลาส / ออบเจกต / Reference type
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 53
![Page 54: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/54.jpg)
หองเรยน
• Attribute– หมายเลขหอง– โตะ– เกาอ– อาจารย– นกเรยน
• Function– เปด– ปด– สอน– เรยน– บารงรกษา
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 54
PDT
ADTADT
![Page 55: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/55.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 55
PDT
ADT
![Page 56: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/56.jpg)
class person {String name;String email;int age;
public String getName() { return name;}public void setName(String n) { name = n; }
}28/11/60
http://www.siam2dev.com [ dr. nattapong songneam] 56
PersonName : StringEmail : StringAge : int
+ setName()+ getName() : String
![Page 57: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/57.jpg)
C#Class Student {private string ST_ID;private string ST_FName;protected string ST_Lname; private string ST_TEL;private string ST_Major;private string ST_Faculty;private string Gender;private Student_CARD ST_Card;
}28/11/60
http://www.siam2dev.com [ dr. nattapong songneam] 57
ADT
PDT
![Page 58: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/58.jpg)
C#
class Student_CARD {
private string University;private string Fname;private date BOD;private string ST_ID;private image IMG;private University university;
}28/11/60
http://www.siam2dev.com [ dr. nattapong songneam] 58
PDT
ADT
![Page 59: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/59.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 59
บตรนกศกษา
นกศกษา
นกศกษา
![Page 60: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/60.jpg)
Inner classes
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 60
หองเรยน
บตรนกเรยน
Is past of
Is past of
หองเรยน
นกเรยนบตรนกเรยน
นกเรยน
![Page 61: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/61.jpg)
University
• Attribute– Name– Address– Building– Person– Faculty
• Function
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 61
PDT
ADT
![Page 62: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/62.jpg)
อาจารย
หองเรยน
กระดานดา
นกศกษา
เกาอโตะ
เราไมไดหมายถง ณ ตอน นจะมอาจารย หรอ นกศกษาหรอไม62http://www.siam2dev.com [ dr.
nattapong songneam]28/11/60
Sub/Child class
Mainclass
![Page 63: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/63.jpg)
จงให concept กบวตถตอไปน
• นกศกษา
-รหส
-ชอ
-นามสกล
-สาขา
-คณะ
-มหาวทยาลย
-เกรด
นกศกษา
attributes
Function-ลงทะเบยนได
-เพม-ถอนได
-ตรวจสอบผลการเรยนได
นาย ก.
นาย ข.
นางสาว ค.
63http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
วชดาHonda jazz
หลวงป เณรคา
![Page 64: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/64.jpg)
นกศกษา
- รหสนกศกษา- ชอ# นามสกล
+ ลงทะเบยนเรยนได + เพม-ถอนได + ตรวจสอบผลการเรยน
attribute
function
Class name
64http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 65: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/65.jpg)
Class student with C#.net
Modifier/visibility
65http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 66: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/66.jpg)
จงให Concept ของรถยนต
รถยนตattributes
Function
?
?
?66http://www.siam2dev.com [ dr.
nattapong songneam]28/11/60
![Page 67: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/67.jpg)
จงให Concept ของรถยนต
รถยนต
Attributes-มลอ-พวงมาลย-เบาะ-เกยร-เครองยนต-ปายทะเบยน
Function+ สตารทเครอง+ หยด+ วง+ เลยว+ ถอยหลง
?
?
?67http://www.siam2dev.com [ dr.
nattapong songneam]28/11/60
![Page 68: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/68.jpg)
รถยนต
?
?
68http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 69: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/69.jpg)
Person
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 69
![Page 70: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/70.jpg)
กระดานดา โตะ เกาอ
นกศกษา
อาจารย
ถามองในทางกลบกนจะไดวาClass หองเรยนประกอบไปดวย
Class กระดานดาClass โตะClass เกาอClass นกศกษาClass อาจารย
มองในมมของ Decomposition
หองเรยน
มองในมมของ composition
70http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 71: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/71.jpg)
การรวมเปนคลาสอาจมองในลกษณะ component กได
• มมมองแบบ Composition• มมมองแบบ Decomposition
71http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 72: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/72.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 72
พดลม
ใบพด มอเตอร
![Page 73: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/73.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 73
MIS
Payroll Inventory E-Learning
![Page 74: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/74.jpg)
componentsAttribute/class
Attribute/class
74http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 75: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/75.jpg)
MS_OFFICE
WORD
EXCEL
PPT
ACCESS
Attribute/class
Attribute/class
75http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 76: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/76.jpg)
components
ลอ
ตวถง
พวงมาลย
Attribute/class
Attribute/class
car
76http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 77: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/77.jpg)
components
RUBBER
Wheel max
พวงมาลย
Attribute/class
Attribute/class
WHEEL
77http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 78: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/78.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 78
![Page 79: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/79.jpg)
ตวอยางของ Component ใน C#.net
79http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 80: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/80.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 80
![Page 81: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/81.jpg)
components
PDT
ADT
student
-ชอ
- บตรนกศกษา
81http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 82: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/82.jpg)
components
- ชอ - นามสกล
PDTSTD_CARD
82http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
- หมายเลข
- รป
- วน/เดอน/ปเกด
![Page 83: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/83.jpg)
บตรนกศกษา
83http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 84: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/84.jpg)
Add class in C#
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 84
![Page 85: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/85.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 85
Student Student_Card
![Page 86: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/86.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 86
Is part of
Data member
class membe
![Page 87: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/87.jpg)
หองเรยน
หองปฏบตการคอมพวเตอร
หองเรยนธรรมดา
87http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 88: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/88.jpg)
มหาวทยาลย
เจาหนาทอาจารยนกศกษา
88http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 89: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/89.jpg)
สงมชวต ส งไมมชวต
คน พชสตว
?
89http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 90: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/90.jpg)
Aggregation Abstraction
• คอ การ พยายามตอบคาถามทวา ม class ใดเปนสวนประกอบ (Is part of) ของ class อนหรอไม และทสาคญ “การประกอบกนของ class ตองทาใหเกด class ใหม ซงม concept ใหมดวย”
• ในทาง object orientation นน การแสดงสญลกษณเพอแสดง Aggregation Abstraction ของ class นน ทาไดโดยการโยงลกศรเปนสเหลยมขนมเปยกปน จาก class ยอยหรอ class ทเปนสวนประกอบ (Composite class) ไปยง Class หลก (Main Class) ดงแสดงในรป
90http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 91: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/91.jpg)
Aggregate
• Required Component• Optional Component
91
ตวอยางเชน
รถจาเปนตองมลอ
รถ
ลอแอร
ชองลม
![Page 92: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/92.jpg)
92
คน
หวใจ
เพศ
attributes
functions
อาย
PDT
ADT
ขา
Aggregation Abs.
![Page 93: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/93.jpg)
93
เครองบน
? นกบน
เครองบน
- ปก
- ลอ
- เครองบนเจท
- บน()
- โดยสาร()
Aggregation Abs.
![Page 94: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/94.jpg)
ขนตอนการทาแอกกรเกชน
ขนตอนการทาแอกกรเกชน ในการทาแอกกรเกชนไมไดมการกาหนดขนตอนท
แนนอนไวอยางชดเจนแตจากประสบการณของผเขยนสามารถสรปออกมาเปน
ขนตอนคราวๆ ไดดงน
ขนตอนท 1. หาคานาม หรอคลาส
ขนตอนท 2. ระบสวนประกอบยอยโดยวาดเปนแผนภาพเพอแสดงสวนประกอบ
ยอย
ขนตอนท 3. กาหนดสวนประกอบทจาเปน และไมจาเปน
ขนตอนท 4. กาหนดคารดนลลต
ขนตอนท 5. กาหนดรายละเอยดของคลาส
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 94
![Page 95: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/95.jpg)
ตวอยางท 4.10
• ตวอยางท 4.10 คอนโดมเนยมโดยทวไปจะประกอบไปดวย
หองพกหลายๆ หอง โดยแตละหองนนจะมสวนประกอบหลกๆ
ดงน 1. หองนอนจานวน 1 หอง 2. หองนาจานวน 1 หอง ซง
จะตองมทกหอง 3. เครองปรบอากาศซงอาจจะมหรอไมมกได
หรอบางหองอาจจะมไดมากกวา 1 เครอง โดยภายในหองนอนจะ
มเตยงนอนอยางนอย 1 หลงแตบางหองอาจจะมมากกวานกได
และมโทรทศนจานวน 1 เครอง
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 95
![Page 96: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/96.jpg)
ขนตอนท 1. หาคานาม หรอคลาส
ขนตอนท 1 หาคานาม หรอคลาส โดยใชคลาสสฟเคชนแอบแทรคชน
จากขอความขางตน จะระบคลาสตางๆ ไดดงน
1) คลาสคอนโดมเนยม
2) คลาสหอง
3) คลาสหองนอน
4) คลาสหองนา
5) คลาสเครองปรบอากาศ
6) คลาสเตยงนอน
7) โทรทศน28/11/60
http://www.siam2dev.com [ dr. nattapong songneam] 96
![Page 97: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/97.jpg)
97
คอนโดมเนยม
หองพก
หองนา เครองปรบอากาศหองนอน
Aggregation Abs.
ขนตอนท 2. ระบสวนประกอบยอยโดยวาดเปนแผนภาพแสดงสวนประกอบ ดงแสดงในภาพ
เตยงนอน โทรทศน
![Page 98: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/98.jpg)
98
คอนโดมเนยม Aggregation Abs.
ขนตอนท 3. กาหนดสวนประกอบทจาเปน(Required)
และไมจาเปน (Optional) ดงแสดงในภาพ
หองนา เครองปรบอากาศ
หองพก
หองนอน
เตยงนอน โทรทศน
![Page 99: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/99.jpg)
99
คอนโดมเนยม Aggregation Abs.
ขนตอนท 4. กาหนดคารดนลลต ดงแสดงในภาพ
หองนา เครองปรบอากาศ
หองพก
หองนอน
เตยงนอน โทรทศน
1..N
1..1 0..N1..1
1..N 0..1
Minimum Cardinality : Min Card
Maximum Cardinality : Max Card
![Page 100: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/100.jpg)
100
Aggregation Abs.
ขนตอนท 5. กาหนด
รายละเอยดของคลาส
1..N
1..1 0..N1..1
1..N 0..1
คอนโดมเนยม-ชอคอนโดมเนยม
- ทตง
หองพก-หมายเลขหอง
-ขนาด
หองนอน หองนา เครองปรบอากาศ- ขนาด - ขนาด - ยหอ
- ขนาด BTU
เตยงนอน โทรทศน- ขนาด - ยหอ
- รน
- เปด()
- ปด()
- ปรบอณหภม()
![Page 101: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/101.jpg)
101
Aggregation Abs.1..N
1..1 0..N1..1
1..N 0..1
คอนโดมเนยม-ชอคอนโดมเนยม
- ทตง
หองพก- หมายเลขหอง
- ขนาด
หองนอน หองนา เครองปรบอากาศ- ขนาด - ขนาด - ยหอ
- ขนาด BTU
เตยงนอน โทรทศน- ขนาด - ยหอ
- รน
- เปด()
- ปด()
- ปรบอณหภม()
- เปด()- นอน()
- อาบนาได()- นอน()
![Page 102: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/102.jpg)
102
1..N
1..2 1..N 1..N
Aggregation Abs.ขนตอนท 5. กาหนดรายละเอยดของคลาส
คอนโดมเนยม- ชอโครงการ
- ทตง
หองพก- หมายเลขหอง
- ขนาดหอง
เตยง- ขนาด
หองนา- ขนาด
เครองปรบอากาศ- ยหอ
- ขนาด
![Page 103: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/103.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 103
![Page 104: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/104.jpg)
104
+ เดน()
- หวเขา
- เทา
คน
ADT
ขา
คน
-ขา
- แขน
-อาย
-เพศ
- หวใจ
PDT
Aggregation Abs.
![Page 105: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/105.jpg)
หองเรยน
การเปนสวนหนง (Is part of)สามารถเขยนแทนดวย สญลกษณ
Is part of
กระดานดา โตะ เกาอ
นกศกษา
อาจารย
105http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 106: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/106.jpg)
หองเรยน
เกาอ อาจารย
- การเปนสวนหนง (Is part of)- การเปนสมาชกของ (Is member of)
Is part of
กระดานดา
กระดานดาหนาหอง
โตะ
โตะตวท 1
โตะตวท 2
นกศกษา
สมชาย
สมหญง
Is member of
Is member of
Is member ofIs member of
106http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 107: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/107.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 107
ธนาคาร
กสกร ทหารไทย
Aggregation Abstraction
ไทยพานชย
ลกคา
Classification Abstractionจนท.
สมหญง
สมชาย
วตถ(Object)
คลาส(clas) Classification Abstraction
Is Member Of
Is Part Of
![Page 108: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/108.jpg)
รถยนต
ลอ เครองยนต
กานลอ ยางเสน
Is member of
กาน 1
108http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
กาน 2
Is member of
กาน 3
Is member of
Is Part Of
Is Part OfIs Part Of
![Page 109: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/109.jpg)
หองเรยน
กระดานดา โตะ เกาอ
บางคร งอาจเกดกรณท class หนงสามารถเปน class ยอยของ class หนงไดพรอมท งยงเปน class ยอยของอก class หนงไดเชนกน
สาขาวชา
อาจารย
นกศกษา
Is part of
109http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
Is part of
Is part of
Is part of
Is part of
![Page 110: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/110.jpg)
รถยนต
ลอ เครองยนต
ลอหนา ลอขางหลง
Is member of
ลอหนา 1
ลอหนา 2
บางคร งอาจเกดกรณท class หนงสามารถเปน class ยอยของ class หนงไดพรอมท งยงเปน class ยอยของอก class หนงไดเชนกน
110http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 111: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/111.jpg)
รถยนต
ทนง ลอ ประต
บางครงอาจเกดกรณท class หนงสามารถเปน class ยอยของ class หนงไดพรอมทงยง
เปน class ยอยของอก class หนงไดเชนกน
เรอยนต
ไฟ
เครองยนต
เครองบน
111http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
Is part of
![Page 112: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/112.jpg)
รถยนต
ประต
บางคร งอาจเกดกรณท class หนงสามารถเปน class ยอยของ class หนงไดพรอมท งยงเปน class ยอยของอก class หนงไดเชนกน
เรอยนต
ไฟ
เครองยนต
เครองบนรถไฟ
ทน ง
ลอ112http://www.siam2dev.com [ dr.
nattapong songneam]28/11/60
Is part of
![Page 113: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/113.jpg)
มหาวทยาลย บรษท พนกงาน
นกศกษา
113http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 114: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/114.jpg)
?
? ? ?
บางครงอาจเกดกรณท class หนงสามารถเปน class ยอยของ class หนงไดพรอมทงยง
เปน class ยอยของอก class หนงไดเชนกน
?
?
?
Computer ?
Is part of
114http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 115: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/115.jpg)
Computer
Monitor Case Mouse
บางคร งอาจเกดกรณท class หนงสามารถเปน class ยอยของ class หนงไดพรอมท งยงเปน class ยอยของอก class หนงไดเชนกน
CCTV
Cable
Monitor
115http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
Is part of
![Page 116: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/116.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 116
![Page 117: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/117.jpg)
รถยนต เรอยนต
เครองยนต
ไฟ
กระจกลอ ทนง ประต
เครองบนIs part of Is part of
![Page 118: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/118.jpg)
Cardinality , Required Component ,Optional Component
สาหรบ Aggregation Abstraction การประกอบกนของ class หรอความสมพนธเชง is part of นนอาจจะเกดกรณท class หลก (main class) ประกอบไปดวย class ยอย (Composite class ) ชนดทหรอ เพยงชนเดยว แตประกอบดวย class ชนดทสอง จานวน 4 ชนขนไป และอาจจะประกอบไปดวยชนดทสาม ไมจากดจานวน หรออาจไมมเลยกได ซงสงทใชในการแสดงความสมพนธ ดงกลาวนเรยกวา Cardinality
118http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 119: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/119.jpg)
Cardinality , Required Component ,Optional Component
ในทาง OO เราเรยก Class ยอย วา Component นนเองโดยเราเรยกสวนประกอบทจาเปนตองมวา Require Componentเชน รถยนตตองมเครองยนต ถาไมมเครองยนต รถยนตก ไมสามารถวงได นนเอง เราเรยกสวนประกอบทไมจาเปนตองมวา Optional Component เชน เครองปรบอากาศในรถยนตไมจาเปนตองมกได หมายถงไมมเครองปรบอากาศรถยนตกยงสามารถวงได รถยนตไมจาเปนตองมกลองมองขางหลงดงนนจงเปน Optional Component
119http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 120: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/120.jpg)
Cardinality , Required Component ,Optional Component
กระดานดา โตะ เกาอ
นกศกษา
อาจารย
mandatorymandatory mandatory mandatory
mandatory
หองเรยน
120http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 121: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/121.jpg)
สวนประกอบของรถยนต
รปจาก : http://www.thaisecondhand.com/product/9951092/ 121http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 122: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/122.jpg)
รถยนต
ประต
1..2 1..1 2..4 4..4
0..1
เครองปรบอากาศ
ลอเครองยนตกระโปรงรถ
Cardinality, Required Component, Optional Component
122http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
Min cardinality
Maxcardinality
![Page 123: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/123.jpg)
สวนประกอบของหนงสอ
รปจาก : http://board.postjung.com/641579.html 123http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 124: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/124.jpg)
Cardinality , Required Component ,Optional Component
หนงสอ
สารบญ
2..2 1..1 1..1 1..N
1..1
บรรณานกรม
ปก คานา บท
124http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 125: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/125.jpg)
หนงสอ
ปก คานา สารบญ บทของเนอหา บรรณานกรม
2..2 1..n 1..n 1..11..1
ต.ย. การเขยน cardinality ของ class หนงสอ
125http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 126: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/126.jpg)
บทของเนอหา
หนาหนงสอ
1..n
126http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 127: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/127.jpg)
หนาหนงสอ
ตวหนงสอ รปภาพ
0..n0..n
ต.ย. การเขยน cardinality ของ class หนาหนงสอ
127http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 128: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/128.jpg)
หนงสอ
ปก คานา สารบญ บทของเนอหา บรรณานกรม
2..2 1..1 1..n 1..11..1
ต.ย. การเขยน cardinality ของ class หนงสอ
หนาหนงสอ
ตวหนงสอ รปภาพ
0..n0..n
1..n
128http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
เลขหนา
0..1
![Page 129: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/129.jpg)
หนงสอ- รหสหนงสอ+ ชอหนงสอ+ อาน+ พมพ
ปกหนงสอ- ประเภทของปก+ พลก
คานา- เนอความ- ชอผแตง+ อาน
สารบญ- เนอความ+ อาน
บทของเนอหา- เนอหาแตละบท + อาน
บรรณานกรม- เนอความ+ อาน
2..2 1..n 1..n 1..11..1
ต.ย. การเขยน cardinality ของ class หนงสอ
หนาหนงสอ- เนอหาแตละหนา- พลก- อาน
ตวหนงสอ- อกขระ+ สะกด
รปภาพ- ภาพ+ ด
0..n0..n
1..n
129http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 130: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/130.jpg)
โรงภาพยนตร
โรงภาพยนตร
เครองฉายภาพยนตร
เบาะ
Problem Domain : โรงภาพยนตร
ทวางแขน
จอภาพยนตร ทนง ประต
1..1 1..1 * 1..*
1..2 1..1
130http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 131: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/131.jpg)
จงใหรายละเอยดของ โรงภาพยนตร
131http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 132: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/132.jpg)
สวนประกอบของโทรศพทมอถอ
รปจาก : http://www.techxcite.com/topic/10867.html 132http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 133: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/133.jpg)
โทรศพทมอถอ
มอถอสมารทโฟน
เคส
เลนส
Problem Domain : โทรศพทมอถอ
ฝาปด
หนาจอ ป มกด กลองถายรป
1..1 1..1 1..* 1..2
0..1 1..1
133http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 134: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/134.jpg)
จงใหรายละเอยดของ โทรศพทมอถอ
• ??
134http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 135: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/135.jpg)
Aggregation
A unfilled diamond shows aggregation. This relationship indicates that one is PART of the other.
An Employee is PART of a division.
But a division can stand on its own without Employees.
135http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 136: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/136.jpg)
Aggregation
136http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 137: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/137.jpg)
Example of a reflexive association relationship
137http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 138: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/138.jpg)
The Person Class : an example in VB.NET
138http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 139: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/139.jpg)
Composite
A filled diamond shows Composite Aggregation. This relationship indicates that one is PART of the other.
An OrderDetail is PART of an order.
But an Order CANNOT stand on its own without Order Details.
139http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 140: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/140.jpg)
Composite• An Engine is PART of a car.• But a Car CANNOT stand on its own without engine.
Car Engine
Car- Engine
+ Start()
+ Stop()
Engine-gas
+ Start()
+ Stop()
ทาใหชดขนโดยการใสรายละเอยดลงไป
140http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 141: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/141.jpg)
Composite
University Faculty
141http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 142: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/142.jpg)
142http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 143: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/143.jpg)
ASSIGNMENT 3_02
1. จงอธบายความหมายของ Aggregation Abstraction2. Cardinality คออะไร3. จงบอกความแตกตางของ Aggregate กบ Composite4. จงอธบายความแตกตางระหวางมมมองของ composition กบ
decomposition
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 143
![Page 144: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/144.jpg)
ASSIGNMENT 3_02(ตอ)
5. จงเขยนแผนภาพทแสดง Aggregation Abstraction ของ Computer PC
6. จงเขยนแผนภาพทแสดง Aggregation Abstraction ของ โทรศพทมอถอ (Mobile)
7. จงเขยนแผนภาพทแสดง Aggregation Abstraction ของ สมดธนาคาร (Bank Account)
8. จงเขยนแผนภาพทแสดง Aggregation Abstraction ของ
144http://www.siam2dev.com [ dr. nattapong songneam]28/11/60
![Page 145: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/145.jpg)
แบบฝกหด
3.1 คลนกรกษาโรคทวไปแหงหนงจะประกอบไปดวยแพทยประจา 1
นาย พยาบาลอยางนอย 1 คน แตอาจจะมากกวานได โดยจะมหอง
สาหรบตรวจรกษาโรคทวไป 1 หอง และหองสาหรบรกษาโรคเฉพาะ
ทางอก 1 หอง และมยารกษาโรคตางๆ เปนจานวนมาก
3.2 ในหองสมดของมหาวทยาลยราชภฏพระนคร จะประกอบไปดวย
เจาหนาทดแลหองสมด อาจารย เจาหนาท ผบรหาร และนกศกษา โดย
เจาหนาทดแลหองสมดจะมจานวน 3 ทาน ผอานวยการหองสมดเปน
ผบรหารดแล 1 ทาน และมนกศกษาและอาจารย ทงมหาวทยาลยเขา
มาใชยม-คนหนงสอตางๆ ในหองสมด 28/11/60
http://www.siam2dev.com [ dr. nattapong songneam] 145
![Page 146: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/146.jpg)
เฉลย3.1 คลนกรกษาโรคทวไปแหงหนงจะประกอบไปดวยแพทยประจา 1
นาย พยาบาลอยางนอย 1 คน แตอาจจะมากกวานได โดยจะมหอง
สาหรบตรวจรกษาโรคทวไป 1 หอง และหองสาหรบรกษาโรคเฉพาะ
ทางอก 1 หอง และมยารกษาโรคตางๆ เปนจานวนมาก
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 146
ขนตอนท 1 แยกคลาส
1.1 คลาส แพทย/ เภสชกร
1.2 คลาส คลนกรกษาโรค
1.3 คลาส พยาบาล
1.4 คลาสหองรกษาโรคทวไป
1.5 คลาสหองรกษาโรคเฉพาะทาง
1.6 คลาสยา
![Page 147: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/147.jpg)
ขนตอนท 2 วาดแผนภาพ
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 147
คลนก
ยา
พยาบาล หองรกษาโรคทวไป หองรกษาโรคเฉพาะทางแพทย
หองรกษาโรคทวไป หองรกษาโรคเฉพาะทาง
![Page 148: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/148.jpg)
ขนตอนท 2 วาดแผนภาพ
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 148
คลนก
ยา
พยาบาล หองตรวจโรค หองรกษาโรคเฉพาะทางแพทย
หองรกษาโรคทวไป หองรกษาโรคเฉพาะทาง
![Page 149: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/149.jpg)
ขนตอนท 3 ใส min – max card
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 149
คลนก
ยา
พยาบาล หองรกษาโรคทวไป หองรกษาโรคเฉพาะทางแพทย
1..1 1..N 1..N 1..N
1..N
![Page 150: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/150.jpg)
ขนตอนท 5 ใส รายละเอยดของคลาส
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 150
ยา
พยาบาล หองรกษาโรคทวไป หองรกษาโรคเฉพาะทาง
1..1 1..N 1..N 1..N
1..N
คลนก
- ชอคลนก
- ทตง
- ชอแพทย
- ความสามารถ
แพทย
![Page 151: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/151.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 151
![Page 152: Lec03 2 Aggregation Abstractionsiam2dev.net/E_Learning/OOAD/Lec03_2_Aggregation_Abstraction_Last_update_28_11_2560...Lec03_2_Aggregation Abstraction • ในบทที่แล้วได้พูดถึง](https://reader033.fdocument.pub/reader033/viewer/2022041703/5e43229f3c54d333e86b8757/html5/thumbnails/152.jpg)
28/11/60http://www.siam2dev.com [ dr.
nattapong songneam] 152