Professional Documents
Culture Documents
Object Oriented Analysis and Design
Object Oriented Analysis and Design
Object Oriented Analysis and Design
Design
Lecture 4
• Actor:
Represents an external person or entity that
interacts with the system.
يمثل او يعرض المستخدمين (من يتفاعل مع النظام) للنظام من
اشخاص او نظم اخرى
Sequence Diagram Drawing
Elements(cont…):
• object :
Represents an object in the system or one of its components.
يعرض احد اجزاء النظام او مكوناته (مثل المستخدمين للنظام او احد اجزائه
كقاعدة البيانات مثال تعتبر جزء من النظام)
Messages in Sequence Diagram:
Simple massage:
: يستخدم هذا النوع عندما
◦ One object sends a message to object
◦ يرسل احد اجزاء النظام رساله لجزء اخر
◦ The sender does not care what happens to the message
◦ في هذه الحالة ال يهتم المرسل بما يحدث لهذه الرسالة
◦ Useful when the recipient can not be controlled
◦ مفيده في حالة ان المستقبل ال يمكن التحكم بطريقة ادائه للمهمة
◦ Simple messages can be used to represent interactions between
components that are not direct method calls (could be http or web
services)
◦ و يمكن استخدامه ايضا في حالة عرض التفاعل بين جزء من النظام مع مكون خارجي قد
تكون خدمة انترنت مثال
Messages In Sequence Diagram(cont .)
• Synchronous Message:
: • الرسائل المتزامنه وهي كاالتي
– The sender sends the message
– يقوم الطرف االول باالرسال
– The recipient accepts the message, and notifies the sender with a
message result.
– يستقبل الطرف االخر الرسالة و يعلم المرسل ان رسالته قد وصلت بالرد عليها بناتج
العملية
– The sender accepts the message result.
– يقوم المرسل باستقبال ناتج العمليه
Messages In Sequence Diagram(cont .)
• If the sender does not accept the message result, then the
whole operation will not continue.
• ستوقف النظام عن اداء اي مهمه لحين استقبال الرد من الطرف االخر
• Synchronous messages are useful to represent procedure calls
or modal dialogs.
• الرسائل المتزامنه مفيده في حالة نداء دوال محددة و انتظار القيمة الناتجة منها او
انتظار المستخدم الدخال بيانات محددة علي شاشة الحوار
Messages In Sequence Diagram(cont .)
• Asynchronous Message:
: • الرسائل غيرالمتزامنه
– The sender sends the message.
– يقوم الطرف االول باالرسال
– The sender does not wait for the return of the message, it
immediately continues execution.
– ال يتوقف المرسل لحين رجوع الرد على رسالته و انما يواصل مباشرة تنفيد الخطوة
التاليه من مهامه
– The recipient may or may not send a reply.
– المستقبل قد يستقبل الرساله او ال يستقبلها
Messages In Sequence Diagram(cont .)
• Asynchronous messages are useful to model:
: • الرسائل غير المتزامنه مفيدة في االنظمة التالية
– Multithreading)(االنظمة المتعددة
– Exception Handling )(معالجة اخطاء التنفيذ
– Modeless dialogs )(
Messages In Sequence
Diagram(cont .)
• Timeouts Message:
:الؤسائل ذات الزمن المحدد
– The sender sends the message
– يقوم الطرف االول باالرسال
– The sender awaits for the return of the message for some time.
– ينتظر المرسل الرد لفترة زمنية محددة
– Execution continues when the recipient replies, or after the
timeout period if the recipient does not reply
– يقوم المرسل باكمال اداء مهامه بمجرد استقبال الرد او بعد نهاية الفترة الزمنيه
المحددة اذا لم يستقبل شئ
– The recipient may or may not send a reply.
– المستقبل قد يجب علي الرسالة او قد ال يجيب
Messages In Sequence Diagram(cont .)
• Timeout messages are useful to model:
• الرسائل محددة الزمن مفيدة في تمثيل
– System Calls
Messages In Sequence Diagram(cont .)
• Return Message:
– Return messages indicate a response to a call
message, although they can also be used with
simple messages to represent request/response
pairs.
– توضح او تمثل االجابة علي رسائل سابقة و يمكن استخدامها مع ال
لعرض الرد علي نداء سابقsimple message
Messages In Sequence Diagram(cont .)
• Create Message:)(رسائل االنشاء
– The message creates the recipient.
– هذه الرسالة تقوم بإنشاء المستقبل
– Create messages are used to represent the dynamic creation of an object
instance. They can also be used to represent the creation of a thread or
task.
محدد عندclass منobject – يتم في هذه الحالة انشاء المستقبل في لحظة االرسال (مثل عمل
thread الحاجة) و تستخدم ايضا عند انشاء
• Destroy Message ()رسائل الحذف
– The message destroys the recipient.
– هذه الرسالة تقوم بإنهاء و حذف المستقبل
– Destroy messages are used to represent the dynamic destruction of an
object instance. They can also be used to represent the destruction of a
thread or task.
محدد عندobject – يتم في هذه الحالة حذف المستقبل عند ارسال هذه الرسالة (مثل حذف
thread الحاجة) و تستخدم ايضا لحذف
Example:
: Customer
1. Create : Order
2. Destroy
Messages In Sequence Diagram(cont .)
• Self Message:
: • الرسائل الذاتية
• A self message can represent a recursive call of an operation,
or one method calling another method belonging to the same
object. It is shown as creating a nested focus of control in the
lifeline’s execution occurrence.
• يتم استخدامها في حالة النداء الذاتي (نداء العملية لنفسها) او ان احد الدوال تقوم
و تظهر كسهم لنفس الجزءobject بنداء دالة اخرى تابعه لنفس ال
Messages format
• Messages have sequence numbers
– The numbers represent the order of interaction
– الرسائل لها ترقيم يوضح ترتيب تنفيذها
• Messages have sequence numbers
– Sequence number can be hierarchical
و1.1 – هذه االرقام يمكن تجزئتها و عرضها بشكل هرمي مثل
هكذا
[Condition] Sequence Number. Return value := MessageName(Arguments)
1. Create : Item
1.1. CheckStock
1.1.1. Yes
Sequence Diagram