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 プログラム内で手続的抽象化を使用することで、メソッドの署名とメソッドが何をするかを維持している限り、メソッドユーザーに変更を通知することなく、メソッドの内部(速度向上、効率化、メモリ使用量の削減など)を変更できる。
- 3.1.A.7 クラスを実装する前に、各クラスの属性と振る舞いを含めた設計に時間を割くことが有益である。この設計は自然言語や図で表現できる。

