Learning Objective 3.1.A: Represent the design of a program by using natural language or creating diagrams that indicate the classes in the program and the data and procedural abstractions found in each class by including all attributes and behaviors.
- 3.1.A.1 Abstraction is the process of reducing complexity by focusing on the main idea. By hiding details irrelevant to the question at hand and bringing together related and useful details, abstraction reduces complexity and allows one to focus on the idea.
- 3.1.A.2 Data abstraction provides a separation between the abstract properties of a data type and the concrete details of its representation. Data abstraction manages complexity by giving data a name without referencing the specific details of the representation. Data can take the form of a single variable or a collection of data, such as in a class or a set of data.
- 3.1.A.3 An attribute is a type of data abstraction that is defined in a class outside any method or constructor. An instance variable is an attribute whose value is unique to each instance of the class. A class variable is an attribute shared by all instances of the class.
- 3.1.A.4 Procedural abstraction provides a name for a process and allows a method to be used only knowing what it does, not how it does it. Through method decomposition, a programmer breaks down larger behaviors of the class into smaller behaviors by creating methods to represent each individual smaller behavior. A procedural abstraction may extract shared features to generalize functionality instead of duplicating code. This allows for code reuse, which helps manage complexity.
- 3.1.A.5 Using parameters allows procedures to be generalized, enabling the procedures to be reused with a range of input values or arguments.
- 3.1.A.6 Using procedural abstraction in a program allows programmers to change the internals of a method (to make it faster, more efficient, use less storage, etc.) without needing to notify method users of the change as long as the method signature and what the method does is preserved.
- 3.1.A.7 Prior to implementing a class, it is helpful to take time to design each class including its attributes and behaviors. This design can be represented using natural language or diagrams.
هدف التعلم 3.1.A: تمثيل تصميم برنامج باستخدام اللغة الطبيعية أو إنشاء مخططات تشير إلى الفئات في البرنامج والبيانات والتجريدات الإجرائية الموجودة في كل فئة من خلال تضمين جميع السمات والسلوكيات.
- 3.1.A.1 التجريد هو عملية تقليل التعقيد من خلال التركيز على الفكرة الرئيسية. من خلال إخفاء التفاصيل غير ذات الصلة بالسؤال الحالي وتجميع التفاصيل ذات الصلة والمفيدة، يقلل التجريد من التعقيد ويسمح بالتركيز على الفكرة.
- 3.1.A.2 يوفر تجريد البيانات فصلًا بين الخصائص المجردة لنوع البيانات والتفاصيل الملموسة لتمثيله. يدير تجريد البيانات التعقيد من خلال إعطاء البيانات اسمًا دون الإشارة إلى التفاصيل المحددة للتمثيل. يمكن أن تأخذ البيانات شكل متغير واحد أو مجموعة من البيانات، كما هو الحال في فئة أو مجموعة بيانات.
- 3.1.A.3 السمة هي نوع من أنواع تجريد البيانات يتم تعريفها في فئة خارج أي طريقة أو باني. متغير الحالة هو سمة تكون قيمتها فريدة لكل حالة من حالات الفئة. متغير الفئة هو سمة مشتركة بين جميع حالات الفئة.
- 3.1.A.4 يوفر التجريد الإجرائي اسمًا لعملية ويتيح استخدام الطريقة بمعرفة ما تفعله فقط، وليس كيفيةقيام بها. من خلال تحليل الطرق، يقوم المبرمج بتقسيم السلوكيات الكبيرة للفئة إلى سلوكيات أصغر من خلال إنشاء طرق لتمثيل كل سلوك فردي أصغر. قد يستخرج التجريد الإجرائي ميزات مشتركة لتعميل الوظيفة بدلاً من تكرار الكود. هذا يسمح بإعادة استخدام الكود، مما يساعد في إدارة التعقيد.
- 3.1.A.5 استخدام المعاملات يسمح بتعميل الإجراءات، مما يتيح إعادة استخدامها مع مجموعة من قيم الإدخال أو المعاملات.
- 3.1.A.6 استخدام التجريد الإجرائي في البرنامج يسمح للمبرمجين بتغيير internals الخاص بالطريقة (لجعلها أسرع، أكثر كفاءة، استخدام تخزين أقل، إلخ.) دون الحاجة إلى إبلاغ مستخدمي الطريقة بالتغيير طالما أن توقيع الطريقة وما تفعله الطريقة محفوظ.
- 3.1.A.7 قبل تنفيذ الفئة، من المفيد تخصيص الوقت لتصميم كل فئة بما في ذلك سماتها وسلوكياتها. يمكن تمثيل هذا التصميم باستخدام اللغة الطبيعية أو المخططات.

