Software Engineering: Each of the following heuristics helps make a good module
ID: 3822759 • Letter: S
Question
Software Engineering:
Each of the following heuristics helps make a good module according to some modularity principle. Identify the principle for each letter.
Modularity principles:
Principle of Small Modules
Principle of Information Hiding
Principle of Least Privilege
Principle of Coupling
Principle of Cohesion
(a) Make all attributes of a class protected or private.
(b) A class should capture exactly one key abstraction.
(c) Make sure an operation needs all its parameters.
(d) Spin off unrelated data into another class.
(e) Minimize the number of classes with which a class collaborates.
(f) Most of the operations in a class should use most of the attributes most of the time.
(g) Model the real world whenever possible.
(h) Do not change the state of an object without going through its public interface.
Explanation / Answer
(a) Make all attributes of a class protected or private. - Principle of Information Hiding
(b) A class should capture exactly one key abstraction. - Principle of Information Hiding
(c) Make sure an operation needs all its parameters. - Principle of Least Privilege
(d) Spin off unrelated data into another class. - Principle of Small Modules
(e) Minimize the number of classes with which a class collaborates.- Principle of Coupling
(f) Most of the operations in a class should use most of the attributes most of the time. - Principle of Cohesion
(g) Model the real world whenever possible.-Principle of Coupling
(h) Do not change the state of an object without going through its public interface. -Principle of Information Hiding
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.