Professional Documents
Culture Documents
مراحل ععداد النموذج المفاهيمي للبيانات
مراحل ععداد النموذج المفاهيمي للبيانات
Stages of elaborating the CDM Model (CDM) مراحل إعداد النموذج المفاهيمي للبيانات
The elaboration of the CDM model involves ( للبياناتCDM) يتضمن إعداد النموذج المفاهيمي
the following steps: :الخطوات التالية
1) Identify the management rules (if these are ) تحديد قواعد التسييييي (إذا لم يتم منحها لك عن1
not given to you); ط يق المستخدمين)؛
2) Elaborate of the data dictionary;
) إعداد قاموس البيانات؛2
3) Identify of the functional dependencies
) بينFD( ) تحييديييد االرتبيياطييات الوظيفييية3
(FD) between data;
البيانات؛
4) Modeling of the MCD model (creation of
MCD ) نميية يية النموذج المفيياهيمي للبيييانييات4
entities then relationship then adding
(إنشاء الكيانات ثم العالقات ثم إضافة الدر ات
cardinalities).
.)التشاركية
Important note: In applied reality, not all of ليسيييل كذ هة، في الواقع التطبيقي:مالحظة هامة
these steps are mandatory, especially preparing the
خاصة إعداد قاموس البيانات وتحديد،الخطوات إلزامية
data dictionary and defining the functional
dependencies, as in many applied cases, creating كمييا هو الحيياث في ك ي من،االرتبيياطييات الوظيفييية
the conceptual data model precedes preparing the
فيياء إنشييييياء النموذج المفيياهيمي،الحيياالت التطبيقييية
data dictionary and functional dependencies,
because the data is insufficient, and what exists is للبييانيات يسييييبق إعيداد قياموس البييانيات واالرتبياطيات
not completely known in the beginning. Even the نء البييانيات ي كيافيية وميا هو مو ود لي،الوظيفيية
perception of having a comprehensive data
وصتر تصييييور و ود قياموس.مع وفايا تميا اميا في البيدايية
dictionary at the beginning is not realistic in
complex cases. .واقعيا في الحاالت المعقدة بيانات شامذ في البداية لي
Thus, there is no linear sequence of these وبالتالي ال يو د تسييلسييذ خطي لهة الخطوات بذ
steps, but rather a set of repetitions and sometimes ميجيميوعيية مين اليتيكي ارات واليتيخيليي اليتيياض عين بيعي
complete abandonment of some steps: :الخطوات أصيانا
1) Draw a model with the entities and ) رسيييم النموذج مع الكيانات والعالقات التي1
associations that seem necessary, ،تبدو ض ورية
2) Evaluate whether what has been designed is ) تقييم ما إذا كاء ما تم تصييييميمي صييييحي احا2
correct and matches what users understand, ،ويتوافق مع ما يفهمي المستخدموء
3) Iterate, gradually completing until the form تييدريجيييا صتر ي ه
ا واإلكميياث،) التك ار3
appears reasonably complete. ا
.مكتمال إلر صد معقوث النموذج
1. Management Rules قواعد التسيير.1
Before you start creating your database قبذ أء تبدأ في إنشياء داوث قاعدة البيانات الخاصية
tables (or even the entities and relationships of بييك (أو صتر الكيييانييات والعالق ية الخيياصييييية بنموذج
your Conceptual Data Model (CDM)), you
عليييك مع اصتيييا ييات يج ي،)المفيياهيمي للبيييانييات
should gather the needs of the future users of
المسيتخدمين المسيتقبليين لتطبيقك وقاعدة البيانات الم اد
your application and the database they want to
use. From these needs, you must be able to قادرا
يج أء تكوء ا، ومن هة االصتيا ات.اسيييتعمالها
establish the management rules for the data to be علر وضيييع قواعد التسييييي الخاصييية بالبيانات الم اد
kept in your Information Systems. .االصتفاظ بها
Example 01: Let's take the example of a علييي لنيخخية م ياث المطور اليةب يجي:01 مثاا
developer who has to computerize a library's IS.
قمنا بوضييع.صوسييبة ن اض المعلومات الخاب بالمكتبة
We have established the following management
rules: :قواعد التسيي التالية
• Rule 01: For each book, we must know the أء نع ل العنواء لكيذ كتياي يجي:01 • القااعاد
title, the year of publication, a summary and
، شيع،وسينة النشي والملخو ونوا الكتاي (رواية
the book type (novel, poetry, science fiction,
etc.); .) إلخ،خياث علمي
• Rule 02: the book may be written by an الكتياي من قبيذ شييييخو يمكن تيخلي:02 • القااعاد
unknown person (in the case of an anonymous
واصيد أو م ل،)مجهوث (في صيالية العميذ المجهوث
work), one or more authors (in which case
their first name, last name, date of birth, and أك (في هية الحيالية يكوء اسييييميي انوث واسييييميي
country of origin are known.); ).انخي وتاريخ ميالد وبلد انصلي مع وفين
• Rule 03: Each copy of a book is identified by كيذ نسييييخية من الكتياي يتم تع ي:03 • القااعاد
a reference made up of letters and numbers
وال يتم نش ها إال،ع مكوء من ص ول وأرقاض بم
and can only be published in one and only one
edition; .في طبعة واصدة فقط
• Rule 04: A registrant (borrower) is المسييجذ (المسااترير) ب قم يتم تع ي:04 • القاعد
identified by a number and must memorize his
ويج أء يحفظ اسيمي انخي واسيمي انوث وعنواني
or her last name, first name, address,
telephone number and e-mail address; ورقم هاتفي وعنواء ب يد اإللكت وني؛
• Rule 05: The registrant may borrow one or يمكن للمسيييجذ أء يسيييتعي نسيييخة أو:04 • القاعد
more copies, or he may not borrow any copy.
لكذ اسييتعارة يج أء، أك كما يمكني أال يسييتعي
For each borrowing, we must know the date
and duration granted (number of days). .)نع ل التاريخ والمدة الممنوصة (عدد انياض
Note: these rules are sometimes given to you, but ،انصيياء هية القواعيد تطعطر ليك في بع:مالحظاة
you may have to establish them yourself in two
:ولكن قد يتعين عليك وضعها بنفسك في صالتين
cases:
1) You are both project management and ) أنل مدي المشييي وا ومالك المشييي وا في1
project owner, and you are developing an
وتقوض بتطوي تطبيق نيابة عنك،الوقل نف
application on your behalf and/or
according to your own directives; أو وفقاا لتو يهاتك الخاصة؛/و
2) What happens most often: future users of ال يتمكن:انصييياء في أ ليي ) مييا يحييد2
your project were not able to provide you المسيييتخدموء المسيييتقبليوء لمشي ي وعك من
with these rules with sufficient precision; تزوييد بهية القواعيد بيدقية كيافيية؛ ولهيةا
this is why you will have to question them السيييب سييييتعين عليك اسيييتجوابهم من أ ذ
in order to establish these rules yourself. .وضع هة القواعد بنفسك
Never forget that as a developer, you have a من واجبك مساعد،ال تنس أبدًا أنه كمطور
duty to assist the project owner if this proves
.صاحب المشروع إذا كان ذلك ضروريًا
necessary.
This is an intermediate step which can be خاصية إذا،هة خطوة وسييطة يمكن أء تكوء مهمة
important, especially if there are several persons قياعيدة كياء هنيا العيدييد من انشييييخياب يعيدوء نف
developing on the same database of a large
. البيانات ذات الحجم الكبي
volume.
The Data Dictionary (DD) is a document ) هو مسييييتنيد يجمع البييانياتDD( قياموس البييانيات
which brings together all the data that you will
التي سيييييتعين علييك االصتفياظ بهيا في قياعيدة البييانيات
have to keep in your database (and which will
therefore appear in the MCD). .)MCD (والتي ست ه بالتالي في نموذج
❖ Mnemonic code: this is a label designating a عبارة عن ملصييق يحدد ز اءا من:❖ رمز ذاكري
piece of data (for example “Title_Book” for Title_Book البييانات (علر سييييبييذ الم ياث
the title of a book); لعنواء الكتاي)؛
❖ Designation: this is a statement describing ما يتوافق مع البيانات هةا عبارة تص:❖ التريين
what the data corresponds to (for example (علر سبيذ الم اث عنواء الكتاي )؛
“title of the book”);
❖ Data type: is an attribute associated with a هي خياصيييييية ت تبط بيالبييانيات:❖ نوع البيااناات
data that tells a computer system how to يمكن.تخب ن اض الكمبيوت بكيفية تفسيي قيمتها
interpret its value. The data type can be: :أء يكوء نوا البيانات
1) Alphabetical (A): when the data is only عندما تتكوء البيانات فقط من:)A( ) جملي1
composed of alphabetical characters إلرA ومنZ إلرA أص ل (من
(from 'A' to 'Z' and from 'a' to 'z' ، ) تشمذ أص ل ال موزZ
including symbols characters),
2) Numeric (N): when the data is composed عندما تتكوء البيانات فقط من:)N( ) رقمي2
only of numbers (integer or real), ، )انرقاض (عدد صحيح أو صقيقي
3) Alphanumeric (AN): when the data can عندما يمكن أء تتكوء:)AN( ) األبجدية الرقمية3
be composed of both alphabetical and ،البيانات من كذ من الشخصيات انبجدية وال قمية
numeric characters,
4) Date: when the data is a date (in YYYY- yyyy- عندما تكوء البيانات تاري اخا (بتنسيق:) تاريخ4
MM-DD format), ، )mm-dd
5) Boolean (Bool): True or False (1 or 0). .)0 أو1( صحيح أو خطخ: (Bool)) منطقي5
❖ Size: it is expressed in number of characters . ويعب عنيي بعيدد الح ول أو انرقياض:❖ الحجم
or numbers. In the case of a date in the format YYYY-DD- في صالة و ود تاريخ بالتنسييق
YYYY-DD-MM, we also count the number 10 أب،كييذ انص ل فيياننييا نحسييييي،MM
of characters, i.e., 10 characters. As for the فال داعي، أميا بيالنسييييبية للنوا المنطقي.أص ل
Boolean type, there is no need to specify the
DBMS لتحيدييد الحجم (يعتميد هيةا علر تطبيق
size (this depends on the DBMS
المستعمذ)؛
implementation);
❖ Observations: Sometimes additional انصيييياء ميالصي ييات فيي بيعي:❖ الاماالحاظااات
remarks or observations (for example if a إذا كانل إصد،إضييييافية (علر سييييبيذ الم اث
piece of data is strictly greater than 0, etc.). .) وما إلر ذلك،0 البيانات أكب من
Let's take the example of our library and the
لنخخة م اث مكتبتنا ون اض إدارة االسيتعارة الةب نحن
borrowing management system that we are
responsible for computerizing. After studying the بعد دراسيية قواعد التسيييي في.مسي ولوء عن صوسييبتي
management rules in (example 01), we can establish
:) التاليDD( ) يمكننا إنشاء قاموس البيانات01 (م اث
the following data dictionary:
Note: the data that appears in the MCD (and (وبالتالي فيMCD البيانات التي ت ه في:ملحوظة
therefore in the data dictionary) must be, in most :قاموس البيانات) يج أء تكوء أولية في مع م الحاالت
cases, elementary:
❖ They must not be calculated: the calculated يج الحصيوث علر البيانات:❖ يجب أال يتم حسااباا
data must be obtained, by calculation, from من البييانيات، عن ط يق الحسييييياي،المحسييييوبية
elementary data which is kept in the database. ، ومع ذليك.انوليية المحفوظية في قياعيدة البييانيات
However, there are some cases where it is الحاالت التي يكوء فيها من المناسييي هنا بع
relevant to keep, for optimization reasons,
، بالبيانات المحسييوبة، نسييباي التحسييين،االصتفاظ
calculated data, the amount of an order for
.م ذ مبلغ الطل علر سبيذ الم اث
example.
❖ They must not be composed: the composed يج الحصوث علر البيانات:❖ يجب أال تكون مكونة
data must be obtained by the concatenation المكونية عن ط يق مع البييانيات انوليية المخزنية
of elementary data stored in the database. For
يتم الحصيوث، علر سيبيذ الم اث.في قاعدة البيانات
example, an address is obtained from a street,
يتم:علر عنواء من شيييييارا وبليدة ورمز ب ييدب
a town and a postal code: it is these last three
data which are kept and therefore which will االصتفياظ بهية البييانيات ال الثية انخي ة وبيالتيالي
appear in the MCD and in the data dictionary. . وفي قاموس البياناتMCD ست ه في
occurrence (or value) of P1 makes it possible to . P2 تجعذ من الممكن مع فة قيمة واصد فقط ليP1 قيمة
know one and only one occurrence of P2.
This dependency is represented like this: :يتم تم يذ هة االرتباط علر النحو التالي
P1 → P2
We say that P1 is the source of the FD and that P2 . هو الادفP2 وأءFD هو مصدرP1 نقوث إء
is the goal.
Furthermore, several data can be the source just as يمكن أء تكوء العديد من البيانات هي المصييدر،عالوة علر ذلك
several data can be the goal of a DF. .DF كما يمكن أء تكوء العديد من البيانات هي هدل
Examples: :أمثلة
P1, P2→P3
P1→ P2, P3
By taking the data from the previous يمكننا إنشيييياء،من خالث أخة البيانات من القاموس السييييابق
dictionary, we can establish the following FDs. . التاليةFDs
Id_Ref → F_Name_Reg, L_Name_Reg, Street_ Reg, City_ Reg, P_Code_i, Tel_ Reg,
Ref_Copy_book → Id_Book
Id_Type_Book → Lab_Type_Book
Id_Edition → Name_Edition
Id_Country → Name_Country
The following conclusions can be deduced from these يمكن اسييييتخالب االسييييتنتييا ييات التييالييية من هيية
FDs:
:FDs االرتباطات الوظيفية
❖ From a borrowing number, we obtain a ،❖ من رقم االستعارة نحصذ علر تاريخ االستعارة
borrowing date, a deadline, the identifier of
ومع ل المسجذ الةب قاض،والموعد النهائي
the registrant who made the borrowing, the
reference of the borrowed copy; ع النسخة المستعارة؛ وم، بالمستعي
❖ From a copy reference, we obtain the نحصذ علر مع ل الكتاي،ع النسخة ❖ ومن م
identifier of the corresponding book;
المقابذ؛
❖ From a book number, we obtain its title, its ❖ ومن رقم الكتاي نحصذ علر عنواني وسنة نش
year of publication, a summary, the
identifier of the corresponding type, its وملخصي ومع ل النوا المقابذ لي ورقم طبعتي؛
edition number;
4. Establish the CDM model CDM إنشاء نموذج.4
If we take our previous data dictionary, we فاننا نسييتطيع وضييع،إذا أخةنا قاموس البيانات السييابق
schematize for example an “Author” entity like
:كالتالي Author تصميم علر سبيذ الم اث لكياء
this:
❖ From this entity, we can find the ❖ من هيةا الكيياء يمكننيا أء نسييييتخلو قياعيدة
following management rule: an
ب قم الم ل يتم تع ي:التسيييييي التييالييية
author is identified by a unique
number (Id_Author) and is (وعييينيييد االسيييييييم انوثId_Author)
characterized by a last name واالسييييم انخييي،(F_Name_Author)
(F_Name_Author), first name
(وتييارييخ اليميييالدL_Name_Author)
(L_Name_Author) and date of birth
(Date_Birth_Author). (Date_Birth_Author).
❖ An entity can have zero, one or ❖ يمكن أء يحتوب الكيياء علر صييييف أو قيمية
more occurrences. To illustrate
لتوضيييييح هيةا المصييييطلح. واصيدة أو أك
this term “occurrence” or
“instance” or “value” which has الم يذ أو القيمة الةب تم استخدامي بالفعذ
already been used several times,
فيمييا يلي م يياث لجييدوث التم يييذ،عيدة م ات
here is an example of an
occurrence table for the Author : لكياء الم ل
entity:
Note: At the conceptual level, we should rather ينبغي لنا أء نتحد، علر المستو المفاهيمي:مالحظة
speak of entity-types, the entities being in fact
والكييانيات هي في الواقع أم لية علر،عن أنواا الكييانيات
instances of entity-types. For simplifying, we will
سينحتفظ بمصيطلحات الكيانات، للتبسييط.أنواا الكيانات
retain the terms entities and associations
throughout the course. .والجمعيات طواث الدورة التدريبية
This table is composed of four instances of the يتيكيوء هييةا اليجييدوث مين أربيع تيمي يييالت (قيييم) ليكيييياء
Author entity.
. الم ل
❖ Generally, the name of the relationship is a إء اسيم العالقة هو فعذ يحدد االرتباط،❖ بشيكذ عاض
verb defining the link between the entities علر.بين الكييانيات التي ت تبط بهيا هية انخي ة
which are linked by the latter. For example:
:سبيذ الم اث
Here, the relationship (association) “Was_born” “ بقياعيدتيWas_born” )م عالقية (ارتبياط وهنيا يمكن ت
translates the following two management rules: :التسيي التاليتين
• An author was born in one and only one ،في بلد واصد فقط • ولد الم ل
country;
أو ولد يمكن أني لم يولد فيي أب م ل،• في بلد ما
• In a country, none, one or more authors
were born. . واصد أو أك م ل
You will notice that this association is characterized by سيييتالصظ أء هةا االرتباط يتميز بهة التعليقات التوضييييحية
these annotations 1-1 and 0-N which allowed us to
. والتي سيييمحل لنا بتحديد قواعد التسييييي السيييابقةN-0 و1-1
define the previous management rules. These
.تسمر هة التعليقات التوضيحية بالعناص انساسية
annotations are called cardinalities.
Notes :
❖ Often, for the same set of management rules, هنا، مجموعة قواعد التسيي لنف،❖ في ك ي من انصياء
several solutions are possible at the conceptual
.العديد من الحلوث الممكنة علر المستو المفاهيمي
level.
❖ For the MCD to be semantically valid, any يج أء ي تبط أب كياء، صحيحا بنائياMCD ❖ لكي يكوء
entity must be linked to at least one
.بعالقة واصدة علر انقذ
association.
❖ There are paid and free modeling tools for م ذMERISE ❖ تو د أدوات نمة ة مدفوعة ومجانية ل ي
MERISE as powerAMC, OpenModelSphere, AnalyseSI وOpenModelSphereوpowerAMC
AnalyseSI, JMerise, etc. .إلخ..JMeriseو
Once the CDM is complete, it can be used to يمكيييييين،CDM بمجيييييي د إكميييييياث نمييييييوذج
create the logical data model (LDM) and then اسيييييتخدامي إلنشييييياء نميييييوذج المنطقيييييي للبيانيييييات
physical data model (PDM). The LDM model is .)PDM( ) ثييييم نمييييوذج المييييادب للبيانيييياتLDM(
a more detailed representation of the data, and the ، هييو تم يييذ أك يي تفصيييالا للبيانيياتLDM النمييوذج
PDM is a representation of the data that is
هيييو تم ييييذ للبيانيييات خييياب بن ييياضPDM ونميييوذج
specific to the database management system that
فيييي.إدارة قاعيييدة البيانيييات اليييةب سييييتم اسيييتخدامي
will be used. In the next lesson, we will discuss
ساااوف نااادرس نماااوذج البياناااات،اليييدرس التيييالي
the Logical Data Model (LDM) in detail.
.) بالتفصيلLDM( المنطقي