Upload
duongdat
View
216
Download
2
Embed Size (px)
Citation preview
11
บทท 5 การวเคราะหพฤตกรรม (Behavior analysis)
5.1 sequence diagram5.2 communication diagram
5.3 state chart diagram5.4 activity diagram
5.5 component diagram5.6 deployment diagram
2
new
33
UML for objected analysis and designRequirementActivity diagrams - ภาพรวมของระบบUse case diagrams - ระบบทาอะไรบาง ใครทาอะไร เกยวพนกนอยางไร :มมมองผใชStructure analysis-Class diagram - model object&class ในระบบBehavior analysis- Sequence diagram - equivalence to Communication diagramเปน diagram มแกนเวลา ทแสดงลาดบการทางานของวตถ มการสง message หากน-Communication diagram - แสดงการทางานรวมกนของ object ในระบบ มลาดบการทางานของวตถ -Statechart diagrams - แสดงสถานะของ object ในระหวางการทางานวาเปนอยางไร มอะไรเกดขนบาง มอะไรมากระตนอธบายการทางานของคลาส-Activity diagrams - แสดงขนตอนการทางานของในเมธอดของ object
Implement diagramComponent diagrams - เปน diagram ทใชอธบายลกษณะทางกายภาพของ system แสดงใหเหนถง สวนประกอบทาง software (Software componentDeployment diagrams - สถาปตยกรรมแบบ physical เปนการมองภาพรวมทงระบบ ท hardware เชอมตอกน
44
UML views and diagrams (OMG 13 diagrams)
allow you to model system for many perspectives or views
Structural View
Class diagrams
Object diagrams
User View
Use Case diagrams
Implementation View
Component diagrams
Behavioral View
Sequence diagrams
Communication diagrams
State diagrams
Activity diagrams
Environment View
deployment diagrams
55
OMG 13 diagram (3 categories)Structure diagram
class , object , component , composite str.,package , deployment
Behavior diagramuse case (ใชใน phase requirement ได) ,activity , state machine
interaction diagramsequence , communication , timing , interaction overview diagram
66
Size of square relative to time spent on workflowh
Inception Elaboration Construction Transition
Project Phases
1 2 3 4 5 6 7 8Iterations within each phaseRequirements
Analysis
Design
Implementation
Test
Workflows
Fountain model
Chapter 2
เรม ละเอยด สราง เปลยน
**ใหสงเกตสงเกต สเหลยมObject-oriented model
77
Difference from Waterfall Life Cycle
• In a waterfall life cycle project the phases and the workflows are linked together
• In the Requirements phase, only Requirements workflow activities are carried out
• All Requirements activity should be completed before work starts on Analysis
• In an iterative life cycle project it is recognised that some Requirements work will be happening alongside Analysis work
8
Requirements
Analysis
Design
Implementation
Test
Requirements
Analysis
Design
Implementation
Test
Requirement phaseverify
Specification phaseverify
Adapted water fall
Chapter 2
99
Not focus on one perspective try to see how they work together
Who or what are you?What do you know?What can you do?
Structure analysis
Behavior analysis
บทท 5 การวเคราะหพฤตกรรม (Behavior analysis)5.1 sequence diagram5.2 communication diagram5.3 state chart diagram5.4 activity diagram5.5 component diagram5.6 deployment diagram
1010
5.1 Sequence diagramSequence diagram show object interaction arranged in a time sequence
วตถแตละตวจะตดตอสอสารกนอยางไร มข นตอนการทางานอยางไร เนนทเวลา เวลาเปลยน การทางานเปลยน โดยม actor เปนตวกระตน
model กจกรรมตาง ๆ ของ object ทเกดในระบบแสดงข นตอนการทางาน การสง message ระหวางวตถแตละวตถจะสงขอมลถงกนวาตองทาอะไร เมอไร
ประโยชนของ Sequence diagram คอ ทาใหเราเหนวาในclass diagram ม operation ใดขาดหายไป หรอควรเพมอะไรเขาไป ชวยให class diagram สมบรณมากยงขน
Interaction sequence diagram (or simply a sequence diagram)
1111
NotationIn a Sequence diagram, classes and actors are listed as columns, with vertical lifelines indicating the lifetime of the object over time.
ObjectObjects are instances of classes, and are arranged horizontally. The pictorial representation for an Object is a class (a rectangle) with the name prefixed by the object name (optional) and a semi-colon.
ActorActors can also communicate with objects, so they too can be listed as a column. An Actor is modeled using the ubiquitous symbol, the stick figure.
LifelineThe LifeLine identifies the existence of the object over time. The notation for a Lifeline is a vertical dotted line extending from an object.
ActivationActivations, modeled as rectangular boxes on the lifeline, indicate when the object is performing an action.
MessageMessages, modeled as solid horizontal arrows between Activations, indicate the communications between objects.
aObject:Class
: Class
1212
ใน Sequence diagram ม 2 แกนแกนต งเปนเวลาแกนนอน แสดงข นตอนการทางานหรอการสงmessageระหวางวตถ แนวต งและแนวนอนตองสมพนธกน
สญลกษณ ใน Sequence diagramรปสเหลยม วตถหรอclassแทนดวยรปสเหลยมเรยงกนตามแนวนอน
ภายในใสชอ object : class (ชอ object อาจละได)
Actor รป stickman ท communicate กบ object
เสนปะ ตามแนวตง แกนเวลา แสดงถงชวตของวตถ
สเหลยมแนวตง ทตรงกบตาแหนงเดยวกบวตถ/class เรยกวา
activation แสดงถงชวงเวลาทวตถกาลงทางาน
เสนลกศร ทาหนาทสงขอความระหวางวตถ (message)
return with value implicit
object creation ----- เสนปะหวลกศรโปรง
aObject : Class
: Class
1313
Component of sequence diagram
aObject:Class1
msg1()
msg3()
msg4()
msg5()
msg2()
aObject:Class2
1414
Component of sequence diagram
Object1
new()
message( )
delete()
Obj2
response
Object construction and destruction
15
Message Passing Syntax
Although the syntax may differ in different langauges, all messages have three identifiable parts:
aGame.displayCard(aCard, 42, 27);
The message receiver The message selector An optional list of arguments
1616
Object Messaging
Objects communicate by sending messages.Sending the message getCost() to an Advert object, might use the following syntax.
currentadvertCost = anAdvert.getCost()
:Campaign anAdvert :Advert
getCost()
1717
public class Universe {static void main() {
Worker peter = new Worker();Boss boss = new Boss();peter.advise(boss);peter.doWork();
}}
object1:Universe object2:Worker object3:Boss
1:object()2.object()
3.advise(boss)
4.doWork()
5.workStarted()
ความรเดมจากOOP
sequence diagram
1818
ตวอยาง หดอาน sequence diagram
1919
Sequence diagram ของการตอโทรศพท
:ผตอโทรศพท
ยกห
สญญาณดง
[ยกหกอน 30 วนาท] ตอ connection
: โทรศพทของผตอโทรศพท
: โทรศพทของผรบโทรศพท :ผรบโทรศพท
หมนเบอรโทร
ยกห
[ไมเกน 30 วนาท] สญญาณดง
หดอาน
2020
Sequence diagram ของการคยโทรศพทและมสายเรยกซอน
:ผตอโทรศพท
คยรบสญญาณเสยง
[มการเปลยนสาย] ตด connection
: โทรศพทของผตอโทรศพท
: โทรศพทของผรบโทรศพท :ผรบโทรศพท
กดเปลยนสาย
[จบการสนทนา] วางห
มสายเรยกซอน
คยรบสญญาณเสยง
[จบการสนทนา] ตด connection
[จบการสนทนา] วางห
หดอาน
2121
:Clients :Console :Monitor :Printer
PressKey(key)
[Key=M] Show()
[Key=P] Print()
Sequence diagram การแสดงผลท monitorและเครองพมพ หดอาน
2222
Sequence diagram for invalid PIN
:Client
Insert ATM card
Verify PIN number
Display main screen
: ATMMachine : BankClient
Request PIN
key PIN number
Bad PIN number
Bad PIN number message
Eject ATM card
Request take card
take card
หดอาน
2323
แสดงยอดคงเหลอ
Sequence diagram แสดงการขอดยอดเงน
:ผใชเครอง :เครองATM :ป มหมายเลข :หนาจอ
สอดบตร()กด(รหส)
[รหสไมถกตอง] แสดงขอความเตอน
:บญชเงนฝาก
[รหสไมถกตอง] เตอน
[รหสถกตอง] ดาเนนการตอ
[รหสไมถกตอง] หยดการทางาน
แสดง Main menuกด(ขอดเงน)
ตรวจสอบยอดคงเหลอ
หดอาน
2424
Sequence diagram ของการถอนเงนดวยเครอง ATM
:ผใชเครอง :เครองATM :ป มหมาย เลข
:หนาจอ :บ/ชเงนฝาก :เครองจายเงน
:เครอง พมพ
สอดบตร
กดรหส(รหส)[รหสไมถกตอง]เตอน
[รหสไมถกตอง]แสดงขอความเตอน
[รหสไมถกตอง]หยดการทารายการ
[รหสถกตอง]ดาเนนการตอ
แสดง main menuกดจานวนเงน(จานวนเงน)
ตรวจสอบยอดเงนคงเหลอ(จานวนเงน)
[จน.เงน<=ยอดคงคาง]จายเงน
พมพ slip[จน.เงน>ยอดคงคาง]แสดง error message
หดอาน
2525
Sequence diagram for new Advert to campaign
: Client
getName()
addNewAdvert()Advert()
:Campaign :Advert
getAdvertDetails()
CampaignManager
listCampaigns()getCampaignDetail()
listAdverts()
newAd:Advert
การทางานตองสมพนธกบ Prototype :ตย.นยงไมมจอภาพ
หดอาน
26
Sequence diagram for check campaign budget
: Client
getName()
getOverheads()
:Campaign :Advert
getCost()
campaign manager
listCampaigns()getCampaignDetails()
checkCampaignBudget()
การทางานตองสมพนธกบ Prototype :ตย.นยงไมมจอภาพ
2727
Sequence diagram for student registration:
RegistrationManager
:Student :Course
s:=findStudent("Jim")registerStudent("Jim","UML")
aStudent:=find("Jim")
[s&c] ok
Registrar
c:=findCourse("UML")
aCourse:=find("UML")
[s&c]register(aStudent)
[(!c) & (!s)] notFound
[(!s) & c] studentnotFound
[(!c) & s] coursenotFound
2828
Sequence diagram for reserve article
:Article Reservation
reserve()
:Order :OrderPosition
giveArticle()
giveOrderPos()
: ArticleStock
opos
article
giveNumber()
number
reserve(article,number)
Description
request orderspositions from Order
split order position into article and number
reserve correspondingnumber of articlesin stock
2929
Additional Example
3030
Sequence diagram แสดงลบ user
3131
3232
sameOK
3333
sameOK
3434
3535
3636
User Interface::AddAdvertUI
boundary class
Campaign
entity class
AddAvert
control class
สญลกษณเพม
for more next page
เวลาเราเขยน Sequence diagram ดานบน วตถหรอ class ทเรยงตามแนวนอนดานบน อาจเขยนดงน
3737
Class Diagram: Stereotypes
Alternative notations for entity class:
Campaign
Campaign
titlecampaignStartDatecampaignFinishDate
getCampaignAdverts( )addNewAdvert( )
<<entity>> Campaign
titlecampaignStartDatecampaignFinishDate
getCampaignAdverts( )addNewAdvert( )
สญลกษณเพม
3838
Class Diagram: Stereotypes
User Interface::AddAdvertUI
User Interface::AddAdvertUI
startInterface( )assignStaff( )selectClient( )selectCampaign( )
<<boundary>>User Interface::AddAdvertUI
startInterface( )assignStaff( )selectClient( )selectCampaign( )
Alternative notations for boundary class:สวนตดตอ
สญลกษณเพม
3939
Class Diagram: Stereotypes
Alternative notations for control class:
AddAvert
Control::AddAdvert
showClientCampaigns( )showCampaignAdverts( )createNewAdvert( )
<<control>>Control::AddAdvert
showClientCampaigns( )showCampaignAdverts( )createNewAdvert( )
สวนควบคม
สญลกษณเพม
Control class are responsible for controlling the flow of event. They transfer the control to the appropriate entity classes depending on the input received from the boundary classes.
40
4141
Sequence diagrams are used to display the interaction between users, screens, objects and entities within the system. It provides a sequential map of message passing between objects over time. Frequently these diagrams are placed under Use Cases in the model to illustrate the use case scenario - how a user will interact with the system and what happens internally to get the work done. Often, the objects are represented using special stereotyped icons, as in the example below. The object labelled Login Screen is shown using the User Interface icon. The object labelled SecurityManager is shown using the Controller icon. The Object labelled users is shown using the Entity icon.
อาน
4242
p.1/2
How to create CD-sale report
4343
p.2/2
4444
Enrolling in a seminar
4545
Outputting transcripts.
4646
Case study : Course registration system by Terry Quatrani
sequence diagramsare great tools in the beginning because they show
you and your customer step-by-step what has to happen
Figure shows how a student successfully gets added to a course. The student (let’s call him Joe) fills in some information and submits the form. The form then talks to the manager and says “add Joe to Math 101.” The manager tells Math 101 that it has to add a student. Math 101 says to Section 1 “are you open?” In this case, Section 1 replies that they are open, so Math 101 tells section 1 to add this student
4747
:Student:RegistrationForm
:RegistrationManager
:Math101. :Math101Section1
1:fill in info
2:sumit3:add student to math101
4:add student5:are you open?
6:add student
Figure shows how a student successfully gets added to a course.
4848
you can use sequence diagrams to drive out testable user interface requirements.
Sequence diagrams good for showing what’s going onfor driving out requirementsand for working with customers.
That usually leads to the question, though, of how many do you need to create? My answer is, “until you do enough.”
do a sequence diagram for every basic flow of every use case.
4949
UML for objected analysis and designRequirementActivity diagrams - ภาพรวมของระบบUse case diagrams - ระบบทาอะไรบาง ใครทาอะไร เกยวพนกนอยางไร :มมมองผใชStructure analysis-Class diagram - model object&class ในระบบBehavior analysis- Sequence diagram - equivalence to Communication diagramเปน diagram มแกนเวลา ทแสดงลาดบการทางานของวตถ มการสง message หากน-Communication diagram - แสดงการทางานรวมกนของ object ในระบบ มลาดบการทางานของวตถ -Statechart diagrams - แสดงสถานะของ object ในระหวางการทางานวาเปนอยางไร มอะไรเกดขนบาง มอะไรมากระตนอธบายการทางานของคลาส-Activity diagrams - แสดงขนตอนการทางานของในเมธอดของ object
Implement diagramComponent diagrams - เปน diagram ทใชอธบายลกษณะทางกายภาพของ system แสดงใหเหนถง สวนประกอบทาง software (Software componentDeployment diagrams - สถาปตยกรรมแบบ physical เปนการมองภาพรวมทงระบบ ท hardware เชอมตอกน
Now
5050
• ตวอยาง ภาษาไทยเลมกตต แจกsheet (caseStudyKitSEQ.ppt)
• ตวอยางการaddของนศ.มช:use case ข นตอน prototype class di Seq.di.
• ตวอยาง เพมเตมอนๆhttp://www.cs.gordon.edu/courses/cps122/AddressBookExample/index.htmlhttp://www.cs.gordon.edu/courses/cps122/ATMExample/index.htmlAddressbookEx.docATMEx.doc
aObject:Class1
msg1()
msg3()
msg4()
msg5()
msg2()
aObject:Class2
5151
เพมเตม UML 2.0sequence diagram ใชเพอแสดงการตดตอระหวาง entity UML 2.0 sequence diagram มคณสมบตเพมเขามาคอ
การเรยกใช interaction ทตองการจากไดอะแกรม เพอนาไปใช ในไดอะแกรมอนหรอเพอนาขอมลมาใชงานได เรยกความสามารถนวา interaction occurrence
Headingบอกชนดไดอะแกรมทใชงานอย
5252
sd Room Reservatin Process
:System:Credit CardAuthorization
System
:Potential GuestI want to reserve the room
Request room type &Reservation span
Identify room type &Reservation span
Indicate possible choices
Select room
Request billing information
Provide bill informationRequest for credit cardvalidation(fee,billInfo)
Transaction validated(authCode)Reservation is guaranteed
(reservationConfirmVal)
มการตรวจสอบ credit card
แนวทางการทา
seq di.รปน
เปนแนวคดเปน
กระดาษทด
5353
sd Validate credit card
:System:Credit CardAuthorization
System
Request for credit cardvalidation(fee,billInfo)
Validation result(status=OK,authCode)
5454
sd Room Reservatin Process
:System:Credit CardAuthorization
System
:Potential GuestI want to reserve the room
Request billing information
Provide bill information
create(DateRange,room,billingInfo )
ReservationConfirmValReservation confirm
(reservationConfirmVal)
RefValidate credit card
:Reservation
5555
การอางอง interaction ใสการอางองใหถกตอง วธนจะชวยลดความซาซอนและทาใหเขาใจงาย
UML 2.0 ม operator opt ตวเลอก เพอบอกวา frame นนไมถกใชเมอใด ซงมการกาหนด explicit guard
ในวงเลบกามป explicit guard ทาหนาทกรองวาเฟรมนนจะถกใชเมอคาของ explicit guard เปนไปตามเงอนไข
loop การทาซา loop minint, maxint, [guard]
alt ทางเลอกอน กรณเรามทางเลอกมากกวาสองเสนทาง มการแบงสวนภายใน เพม guard [else] เขาไป
5656
sd Room Reservatin Process
:System:Credit CardAuthorization
System
:Potential GuestI want to reserve the room
Request billing information
Provide bill information
<<Craete>>create(DateRange,room,
billingInfo )
ReservationConfirmValReservation confirm
(reservationConfirmVal)
RefSystem.Transaction.Status=Validation
Credit Card(fee,billingInfo,System.Transaction.AC=authCode):OK
:Reservation
Status=OKopt
ตวอยาง การใช operator opt
5757
sd Room Reservatin Process
:System:Credit Card
Authorization System
:Potential Guest
I want to reserve the room
Request billing information
Provide bill information
<<Craete>>
create(DateRange,room,
billingInfo )
ReservationConfirmVal
Reservation confirm (reservationConfirmVal)
RefSystem.Transaction.Status=Validation
Credit Card(fee,billingInfo,System.Transaction.AC
=authCode):OK
:ReservationStatus=OK
opt
step 1,3[status=BAD]
breakcancel
sorry,please try again later.
[else]
ตวอยาง การใช operator loop alt
5858
จากประสบการณการสอน sequence diagram พบวา
นศ. Very good at thinking in logical mannerand/or good at writing software code
การ create sequence diagram
: เรมจาก identify scope of : what I’m trying to model
The heart of the diagram is in the message
5959
เพมเตมจาก sequence diagram
หากซบซอน abstractขน
เราจะสราง Interaction overview diagram
6060
OMG 13 diagram (3 categories)Structure diagram
class , object , component , composite str.,package , deployment
Behavior diagramuse case (ใชใน phase requirement ได) ,activity , state machine
interaction diagramsequence , communication , timing , interaction overview diagram
6161
Sequence diagram
:Client :Campaign :AdvertgetName
listCampaigns
listAdverts
AdvertnewAd:Advert
addNewAdvert
Lifeline Activation or Execution Object creation
:CampaignManager
sd Add a new advert to a campaign
loop
loop
Interaction Operator
Interaction Constraint
Combined Fragment(loop)[For all client’s campaigns]
getCampaignDetails
[For all campaign’s adverts] getAdvertDetails
Sequence diagram is enclosed in aframe
Frame label
เดม ตอนเรมคด
6262
:Client :Campaign :Advert
listCampaigns
listAdverts
AdvertnewAd:Advert
:CampaignManager
sd Add a new advert to a campaign
loop
loop
:AddAdvertUI
:AddAdvert
addNewAdvert
getClient
selectClient
loop
selectCampaign
addNewAdvert
getCampaignDetails
startInterface
[For all clients]
showClientCampaigns
showCampaignAdverts
createNewAdvert
[For all client’s campaigns]
[For all campaign’s adverts]
getAdvertDetails
Boundarylifeline
Controllifeline
Now ปรบsd มจอภาพกอน startInterface ไปดงclientเดม ตอนเรมคด
6363
Object Selector Notation
:Client campaign[i]:Campaign
advert[j]:Advert
getName
listCampaigns
checkCampaignBudget
getCampaignDetails
getCost
:CampaignManager
sd Check campaign budget
loop
loop
getOverheads
[i=1;i<=campaign.count; i++ ]
[j=1;j<=advert.count; j++ ]
Object selector notation
Interaction constraint refers to variable used in object selector notation
6464
Interaction Operators
:Client campaign[i]:Campaign
advert[j]:Advert
getName
listCampaigns
checkCampaignBudget
getCampaignDetails
getCost
:CampaignManager
sd Check campaign budget
getOverheads
loop (1, *)
Interaction Operator with parameters
loop (1, *)
[i<=campaign.count ]
[ j<=advert.count ]
6565
:Client :Campaign :AdvertgetName
listCampaigns ref
ref
:CampaignManager
Advert
addCostedAdvert
newAd:Advert
newRequest:Request
alt
[else]
sd Add a new advert to a campaign if within budget
List client campaigns
[totalCost <= budget]
Request
Get campaign budget
alt interaction operator shows branching
Two interaction operands, one for each
alternativeอาน
6666
:Client :Campaign :AdvertgetName
listCampaigns
:CampaignManager
sd Check campaign budget
ref
ref
Gate showing the message enter this interaction occurrence
List client campaigns
Get campaign budget
ref interaction operator indicates interaction occurrence that references an interaction fragment
Next slide
Next slide
6767
Interaction Fragment
:Client :Campaign
listCampaigns
getCampaignDetails
sd List client campaigns
loop
Gate showing the message enter this Interaction Fragment
[For all client’s campaigns]
Interaction fragment that is referenced in
Check campaign budgetsequence diagram
6868
Interaction Fragment
:Campaign :Advert
getCost
sd Get campaign budget
loop
getOverheads
checkCampaignBudget
:CampaignManager
[For all campaign’s adverts]
Interaction fragment that is also referenced in
Check campaign budgetsequence diagram
:Client :Campaign :AdvertgetName
listCampaigns ref
:CampaignManager
alt
[else]
sd Add a new advert to a campaign if within budget
List client campaigns
[totalCost <= budget]ref
Create advert
Create requestref
ref
Get campaign budget
addCostedAdvert
1
2
3
4
ตย.การเขยน
70
:Client :Campaign
listCampaigns
getCampaignDetails
sd List client campaigns
loop [For all client’s campaigns]
Interaction Fragment Used1
Interaction Fragment Used
:Campaign :Advert
getCost
sd Get campaign budget
loop
getOverheads
checkCampaignBudget
:CampaignManager
[For all campaign’s adverts]
2
Interaction Fragment Used
:Campaign :Advert
Advert newAd:Advert
sd Create advert
3
Interaction Fragment Used
:Campaign :Advert
newRequest:RequestRequest
sd Create request
4
Timing Diagrams
• A new feature in UML 2.0• Show how time constraints affect
interactions between lifelines• The sequence diagram Car enters car park is the basis for the subsequent timing diagram
Timing Diagrams:TicketMachine :Barrier after:WeightSensor
sd Car enters car park
raiseBarrier
lowerBarrier
before:WeightSensor
activate
Raised
Lowered
LoweredActive
deactivate
Blocked
barrierLowered
Inactive
ticketRequested
สญลกษณ เปนแนวคด วาเกดอะไร หากมการกระตน เพอนามาเขยน Timing Diagram
1.แผงกนระดบlower2.จบนน.ได TicketMa กactive3.reqตว แผงยก4.Sensor mas-- TicketMadeactivate TicketMa Block5.แผงกนลง6.TicketMa..inactive
Timing Diagrams
sd Car enters car park lifelines :Barrier, :TicketMachine
:Bar
rier
:Tic
ketM
achi
ne
Lowered
Raised
Inactive
Active
Blocked
t
{t..t+3s}Timing Constraint
raiseBarrier
barrierLowered
Diagram has two instances, one for
each lifeline
Sloped line represents duration
of state change
Message from one lifeline to another
Timing Diagrams
sd Car enters car park lifelines :Barrier, :TicketMachine
:Bar
rier
:Tic
ketM
achi
ne
Lowered
Raised
Inactive
Active
Blocked
ตย.
References
• UML Reference Manual (OMG, 2004)• Bennett, Skelton and Lunn (2005)
(For full bibliographic details, see Bennett, McRobb and Farmer)
7979
ตอนน
use caseclass diagramsequence
ตย. Project
Part ตอไปจะเรยน 5.2 communication diagramจากนนเราศกษาและชใหเหนความสมพนธของ
use caseclass diagramsequence / communication diagram
การวเคราะหพฤตกรรมเพอหาattribute/method ของ class diagram ทสมบรณขน