التحليل: النمذجة المنطقية للعمليات (الجزء الأول)
تغطي هذه الوحدة أساسيات النمذجة المنطقية للعمليات باستخدام مخططات تدفق البيانات (DFDs)، وقواعد رسمها، ومستوياتها، وموازنتها، بالإضافة إلى استخدام جداول القرار لنمذجة المنطق.
Analysis: Logical Modeling of Processes (Part-1)
This module covers the fundamentals of logical process modeling using Data Flow Diagrams (DFDs), their rules, levels, balancing, and the use of decision tables for logic modeling.
أهداف التعلم
- شرح استخدام النمذجة المنطقية لمخططات تدفق البيانات (DFD).
- إثبات القدرة على استخدام مخططات تدفق البيانات كأداة لدعم تحليل نظم المعلومات.
- تطبيق قواعد رسم مخططات تدفق البيانات وتجنب الأخطاء الشائعة.
- فهم وتطبيق مفهوم التحلل الوظيفي وموازنة مخططات تدفق البيانات عبر المستويات المختلفة.
- نمذجة منطق النظام باستخدام جداول القرار.
- Explain the use of Data Flow Diagram logical modeling.
- Demonstrate the use of data flow diagrams as a tool to support the analysis of information systems.
- Apply DFD diagramming rules and avoid common mistakes.
- Understand and apply functional decomposition and DFD balancing across different levels.
- Model system logic using Decision Tables.
1 نمذجة العمليات ومخططات تدفق البيانات (DFD)
1 Process Modeling and Data Flow Diagrams (DFD)
نمذجة العمليات هي تمثيل رسومي لكيفية التقاط النظام للبيانات ومعالجتها وتخزينها وتوزيعها، تماماً مثل خريطة شبكة المياه في المدينة.
Process modeling graphically represents how a system captures, manipulates, stores, and distributes data, much like a city's water pipe network.
تتضمن نمذجة العمليات استخدام معلومات تم جمعها أثناء تحديد المتطلبات لتمثيل العمليات وهياكل البيانات.
مخطط تدفق البيانات (DFD) هو صورة لحركة البيانات بين الكيانات الخارجية والعمليات ومخازن البيانات داخل النظام.
على عكس المخططات الانسيابية (Flowcharts) التي تصور تفاصيل الأنظمة المادية، تصور مخططات DFD تدفق البيانات المنطقي بشكل مستقل عن التكنولوجيا المستخدمة.
Process modeling involves using information gathered during requirements determination to represent processes and data structures.
A Data Flow Diagram (DFD) is a picture of the movement of data between external entities, processes, and data stores within a system.
Unlike system flowcharts that depict physical system details, DFDs depict logical data flow independent of technology.
لماذا نستخدم DFDs؟ لأنها توفر لغة تواصل مشتركة بين المحللين والمستخدمين خالية من التعقيدات التقنية.
المخرجات الأساسية تشمل المخطط السياقي (Context DFD) الذي يحدد نطاق النظام، ومخططات النظام الحالي (لفهم الوضع الراهن)، ومخططات النظام الجديد (المستقلة عن التكنولوجيا) التي توضح المتطلبات الوظيفية.
Why use DFDs? They provide a technology-independent common language between analysts and users.
Key deliverables include the Context DFD (defining system scope), DFDs of the current physical/logical system (to understand the status quo), and DFDs of the new logical system (showing functional requirements and data flows).
| مخططات تدفق البيانات (DFDs)Data Flow Diagrams (DFDs) | المخططات الانسيابيةSystem Flowcharts | |
|---|---|---|
| التركيزFocus | التدفق المنطقي للبياناتLogical data flow | تفاصيل النظام الماديPhysical system details |
| الاعتماد على التكنولوجياTechnology Dependence | مستقلة عن التكنولوجياIndependent of technology | تعتمد على التكنولوجياDependent on technology |
| تمثيل الوقتTiming Representation | لا يمثل الوقت بشكل جيدTime is not represented well | يمثل التسلسل الزمني بوضوحClearly represents chronological sequence |
لماذا نعتبر مخططات تدفق البيانات (DFDs) مستقلة عن التكنولوجيا مقارنة بالمخططات الانسيابية (Flowcharts)؟ Why are DFDs considered technology-independent compared to system flowcharts?
لأن DFDs تركز على 'ماذا' يحدث للبيانات (المنطق) وليس 'كيف' يتم تنفيذه (الأجهزة، البرمجيات، أو الأشخاص)، بينما المخططات الانسيابية توضح تفاصيل التنفيذ المادي.
Because DFDs focus on 'what' happens to the data (logic) rather than 'how' it is implemented (hardware, software, or people), whereas flowcharts show physical implementation details.
2 قواعد رسم مخططات تدفق البيانات
2 DFD Diagramming Rules
قواعد صارمة تمنع حدوث 'معجزات' (مخرجات بدون مدخلات) أو 'ثقوب سوداء' (مدخلات بدون مخرجات) في النظام.
Strict rules that prevent 'miracles' (outputs without inputs) or 'black holes' (inputs without outputs) in a system.
هناك قواعد أساسية لكل عنصر في DFD:
- العملية (Process): يجب أن تحتوي على مدخلات ومخرجات معاً. لا يمكن أن يكون لها مدخلات فقط أو مخرجات فقط. تُسمى بأفعال (Verb phrases).
- مخزن البيانات (Data Store): لا يمكن للبيانات أن تنتقل مباشرة من مخزن لآخر، أو من كيان خارجي لمخزن، أو من مخزن لكيان خارجي. يجب أن تمر عبر عملية. تُسمى بأسماء (Noun phrases).
- المصدر/الوجهة (Source/Sink): لا يمكن للبيانات أن تنتقل مباشرة بين كيانين خارجيين بدون المرور بعملية. التفاعلات بين الكيانات الخارجية تقع خارج نطاق النظام ولا تُرسم.
- تدفق البيانات (Data Flow): لا يمكن أن يعود التدفق مباشرة إلى نفس العملية؛ يجب أن يمر بعمليات وسيطة. التدفق المزدوج (Bidirectional) يُمثل بسهمين منفصلين.
There are fundamental rules for each DFD component:
- Process: Must have both inputs and outputs. Cannot have only inputs (black hole) or only outputs (miracle). Labels should be verb phrases.
- Data Store: Data cannot move directly from one store to another, from an external entity to a store, or from a store to an external entity. It must move through a process. Labels should be noun phrases.
- Source/Sink: Data cannot move directly between external entities without going through a process. Interactions between external entities are outside the system and not represented.
- Data Flow: Cannot go directly from a process to itself; must go through intervening processes. Bidirectional flow is represented by two separate arrows.
تضمن هذه القواعد النزاهة المنطقية للنظام.
على سبيل المثال، منع الاتصال المباشر بين مخزني بيانات يعكس حقيقة أن البيانات لا يمكن أن تعالج نفسها أو تنتقل من تلقاء نفسها؛ يجب أن يكون هناك برنامج أو إجراء (عملية) يقوم بنقلها.
التدفقات المتفرعة (Forked) أو المدمجة (Joined) يجب أن تشير إلى نفس عنصر البيانات بالضبط.
These rules ensure the logical integrity of the system.
For instance, preventing direct communication between two data stores reflects the reality that data cannot process or move itself; a program or action (process) must execute the transfer.
Forked or joined data flows must refer to the exact same data item, not different items.
لماذا لا يتم تمثيل التفاعلات بين الكيانات الخارجية (Sources/Sinks) في مخطط DFD؟ Why are interactions between external entities (Sources/Sinks) not represented in a DFD?
لأن هذه التفاعلات تحدث خارج حدود النظام الذي يتم تحليله، ولا يتحكم فيها النظام أو يعالجها.
Because these interactions occur outside the boundaries of the system being analyzed, and the system neither controls nor processes them.
3 التحلل الوظيفي ومستويات DFD
3 Functional Decomposition and DFD Levels
عملية تكرارية لتقسيم النظام من نظرة عامة شاملة إلى تفاصيل دقيقة، مثل التكبير (Zoom in) في خرائط جوجل.
An iterative process of breaking down a system from a high-level overview into finer details, like zooming in on Google Maps.
يتم إنشاء مخططات DFD بمستويات مختلفة من التفصيل:
- المخطط السياقي (Context DFD): نظرة عامة على النظام التنظيمي. يحتوي على عملية واحدة فقط (تمثل النظام بأكمله)، ولا يظهر فيه أي مخازن بيانات.
- مخطط المستوى 0 (Level-0 DFD): يمثل العمليات الرئيسية للنظام، وتدفقات البيانات، ومخازن البيانات بمستوى عالٍ من التفصيل. تُرقم العمليات كـ 1.0، 2.0، إلخ.
- مخطط المستوى 1 (Level-1 DFD): ينتج عن تحليل إحدى عمليات المستوى 0. تُرقم العمليات كـ 1.1، 1.2، إلخ.
- مخطط المستوى n (Level-n DFD): نتيجة لتحليلات متداخلة.
- المخططات الأولية (Primitive DFDs): أدنى مستوى منطقي للتحلل، حيث يتم تقليل العملية إلى قرار واحد أو عملية قاعدة بيانات واحدة.
DFDs are created at various levels of detail:
- Context DFD: Overview of the organizational system. Contains only ONE process symbol (representing the entire system) and NO data stores.
- Level-0 DFD: Represents the system's major processes, data flows, and data stores at a high level. Processes are labeled 1.0, 2.0, etc.
- Level-1 DFD: Results from the decomposition of a Level-0 process. Processes are labeled 1.1, 1.2, etc.
- Level-n DFD: Result of n nested decompositions.
- Primitive DFDs: The lowest logical level of decomposition, where a process is reduced to a single decision, calculation, or database operation.
متى نتوقف عن التحلل؟
نتوقف عندما يتم تقليل كل عملية إلى قرار أو حساب واحد، أو عندما يمثل كل مخزن بيانات كياناً واحداً، أو عندما لا يهتم مستخدم النظام برؤية المزيد من التفاصيل، أو عندما نعتقد أننا أظهرنا كل نموذج عمل كتدفق بيانات واحد.
When do we stop decomposition?
We stop when each process is reduced to a single decision/calculation, when each data store represents data about a single entity, when the user doesn't care to see more detail, or when every business form/transaction is shown as a single data flow.
لماذا لا يحتوي المخطط السياقي (Context Diagram) على مخازن بيانات؟ Why does a Context Diagram contain no data stores?
لأن المخطط السياقي يعامل النظام كـ 'صندوق أسود' ويتجاهل التفاصيل الداخلية (بما في ذلك تخزين البيانات)، ويركز فقط على التفاعلات مع الكيانات الخارجية.
Because the Context Diagram treats the system as a 'black box' and ignores internal details (including data storage), focusing only on interactions with external entities.
4 موازنة مخططات تدفق البيانات (DFD Balancing)
4 DFD Balancing
قانون حفظ البيانات: ما يدخل في العملية ذات المستوى الأعلى يجب أن يدخل في المخطط التفصيلي الخاص بها، وما يخرج منها يجب أن يخرج منه.
The law of data conservation: whatever flows into a high-level process must flow into its detailed diagram, and whatever flows out must flow out.
الموازنة (Balancing): هي الحفاظ على المدخلات والمخرجات لعملية DFD عندما يتم تحليل تلك العملية إلى مستوى أدنى. المخطط المتوازن يعني أن:
- عدد المدخلات إلى DFD في المستوى الأدنى يساوي عدد المدخلات للعملية المرتبطة بها في DFD ذي المستوى الأعلى.
- عدد المخرجات من DFD في المستوى الأدنى يساوي عدد المخرجات للعملية المرتبطة بها في DFD ذي المستوى الأعلى.
Balancing: The conservation of inputs and outputs to a DFD process when that process is decomposed to a lower level. A balanced DFD means:
- Number of inputs to lower-level DFD equals the number of inputs to the associated process of the higher-level DFD.
- Number of outputs to lower-level DFD equals the number of outputs to the associated process of the higher-level DFD.
هناك قواعد متقدمة للموازنة: يمكن تقسيم تدفق البيانات المركب في مستوى ما إلى تدفقات بيانات مكونة في المستوى التالي، ولكن لا يمكن إضافة بيانات جديدة، ويجب حساب جميع البيانات الموجودة في التدفق المركب.
الاستثناء الوحيد هو في أدنى مستوى (Primitive DFDs)، حيث يمكن إضافة تدفقات بيانات جديدة لتمثيل البيانات المرسلة في ظروف استثنائية (مثل رسائل الخطأ).
Advanced balancing rules: A composite data flow on one level can be split into component data flows at the next level, but no new data can be added, and all data in the composite must be accounted for.
The only exception is at the lowest level of DFDs, where new data flows may be added to represent data transmitted under exceptional conditions (e.g., error messages).
إذا كان لعملية في المستوى 0 تدفق بيانات واحد كمدخل، هل يمكن أن يكون للمستوى 1 التابع لها ثلاثة تدفقات مدخلات؟ If a Level-0 process has one input data flow, can its corresponding Level-1 diagram have three input data flows?
نعم، ولكن فقط إذا كان التدفق المدخل في المستوى 0 هو تدفق 'مركب' (Composite) وتم تقسيمه إلى مكوناته الثلاثة في المستوى 1، دون إضافة بيانات جديدة.
Yes, but ONLY if the input flow at Level-0 is a 'composite' data flow that is split into its three exact component parts at Level-1, without adding any new data.
5 جداول القرار (Decision Tables)
5 Decision Tables
مصفوفة تنظم المنطق المعقد للقرارات، حيث تربط بين الشروط المحتملة والإجراءات الناتجة عنها بوضوح.
A matrix that organizes complex decision logic, clearly mapping possible conditions to their resulting actions.
جدول القرار: تمثيل مصفوفي لمنطق القرار؛ يحدد الشروط المحتملة للقرار والإجراءات الناتجة. يتكون من:
- أجزاء الشرط (Condition stubs): الجزء الذي يسرد الشروط ذات الصلة بالقرار.
- أجزاء الإجراء (Action stubs): الجزء الذي يسرد الإجراءات التي تنتج عن مجموعة معينة من الشروط.
- القواعد (Rules): الجزء الذي يحدد الإجراءات التي يجب اتباعها لمجموعة معينة من الشروط.
Decision Table: A matrix representation of the logic of a decision; it specifies the possible conditions for the decision and the resulting actions. It consists of:
- Condition stubs: The part that lists the conditions relevant to the decision.
- Action stubs: The part that lists the actions that result for a given set of conditions.
- Rules: The part that specifies which actions are to be followed for a given set of conditions.
لتبسيط جداول القرار، نستخدم مفهوم الشرط غير المبالي (Indifferent condition): وهو شرط في جدول القرار لا تؤثر قيمته على الإجراءات المتخذة لقاعدتين أو أكثر.
بناء جدول القرار يتضمن:
- تسمية الشروط وقيمها.
- تسمية الإجراءات الممكنة.
- سرد جميع القواعد الممكنة.
- تحديد الإجراءات لكل قاعدة.
- تبسيط الجدول (عن طريق دمج القواعد باستخدام الشروط غير المبالية).
To simplify decision tables, we use the concept of an Indifferent condition: a condition whose value does not affect which actions are taken for two or more rules.
Constructing a decision table involves:
- Naming conditions and their values.
- Naming possible actions.
- Listing all possible rules.
- Defining actions for each rule.
- Simplifying the table (by merging rules using indifferent conditions, often denoted by a dash '-').
كيف يساعد 'الشرط غير المبالي' في تقليل حجم جدول القرار؟ How does an 'indifferent condition' help in reducing the size of a decision table?
يسمح بدمج أعمدة (قواعد) متعددة في عمود واحد، حيث يتم استبدال قيمة الشرط الذي لا يؤثر على النتيجة برمز (مثل '-')، مما يقلل التكرار.
It allows merging multiple columns (rules) into one by replacing the condition value that doesn't affect the outcome with a symbol (like '-'), thereby reducing redundancy.