オブジェクト指向設計の特徴はどれか。
平成21年度 秋期 ITパスポート試験 問47
This question's explanation and your answers so far.
問 47
Incorrectア
This is the opposite of the truth. A main aim of object-oriented design is to improve reusability, maintainability, and productivity through class inheritance and the reuse of componentized objects. The statement that it never improves them is wrong.
- イ
正解 In object-oriented design, data (attributes) and the procedures that operate on them (methods) are bundled into a single object, and its internals are hidden from the outside. This is called encapsulation (information hiding). Users can invoke the functions simply through the interface the object exposes, that is, by sending it a message, without needing to know the details of the internal data structures or algorithms. As a result, changing the internal implementation does not affect the users, and the object is easier to reuse as a component. Choice イ states exactly this property, so it is correct.
Incorrectウ
Object-oriented design divides a system into highly independent objects and combines them as components, so it is in fact especially effective for large-scale software development. Saying that it is not used for large-scale development is wrong.
Incorrectエ
Designing around processing procedures and keeping data separate from the program is the idea behind procedural (structured) design. Object-oriented design unifies data and processing and treats them together as an object, so this description is the reverse of the truth.
- The core of object-oriented design is encapsulation (information hiding): data and procedures are unified, and only the interface (messages) is exposed to the outside. Users can use the object without knowing its internal structure.
- Object orientation raises reusability and productivity through inheritance and componentization, and it also suits large-scale development. Being centered on processing procedures with data kept separate is the contrasting characteristic of structured design.