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 השתקה של שלבים מספקת שם לתהליך ומאפשרת לשיטה להיות מופעלת רק כאשר יודעים מה היא עושה, לא כיצד היא עושה זאת. באמצעות פירוק שיטות, מתכנת מפרק התנהגויות גדולות יותר של הכיתה להתנהגויות קטנות יותר על ידי יצירת שיטות המייצגות כל התנהגות קטנה בודדת. השתקת שלבים עשויה לחלץ מאפיינים משותפים כדי לגנרלize פונקציונליות במקום להכפיל קוד. זה מאפשר שימוש חוזר בקוד, שמסייע בניהול מורכבות.
- 3.1.A.5 השימוש בפארמטרים מאפשר גנרלזציה של הליכים, ומאפשר לשימוש חוזר בהם עם מגוון ערכי כניסה או ארגומנטים.
- 3.1.A.6 השימוש בהשתקת שלבים בתוכנית מאפשר למתכנתים לשנות את הפנים של שיטה (כדי להפכה מהירה יותר, יעילה יותר, לצרוך פחות אחסון, וכו') ללא הצורך בהודעת משתמשי השיטה על השינוי כל עוד חתימת השיטה ומה שהשיטה עושה נשמרים.
- 3.1.A.7 לפני מימוש כיתה, מומלץ לקחת זמן לעצב כל כיתה כולל את האטריביוטים וההתנהגויות שלה. עיצוב זה ניתן לייצוג באמצעות שפה טבעית או דיאגרמות.

