Java 1. A dependency on an interface is less coupling then a dependency on a con
ID: 3809894 • Letter: J
Question
Java
1. A dependency on an interface is less coupling then a dependency on a concrete class.
a) True
b) False
-----------------------------------------------------------------------------------------------
2. Which of the following is not an example of the software design principle of separation of concerns?
a) A web page with content expressed in HTML and presentation style in CSS.
b) Dividing a large project into phases such as: requirements, design and implementation.
c) The OSI Reference Model.
d) Having one module responsible for performing business transactions and another for data access.
Explanation / Answer
1. A dependency on an interface is less coupling then a dependency on a concrete class.
a) True
b) False
Ans: True
This allows for loose coupling for two main reasons: 1- abstractions are less likely to change than concrete types, which means the dependent code is less likely to break. 2- different concrete types can be used at runtime, because they all fit the abstraction. New concrete types can also be added later with no need to alter the existing dependent code.
-----------------------------------------------------------------------------------------------
2. Which of the following is not an example of the software design principle of separation of concerns?
a) A web page with content expressed in HTML and presentation style in CSS.
b) Dividing a large project into phases such as: requirements, design and implementation.
c) The OSI Reference Model.
d) Having one module responsible for performing business transactions and another for data access.
Ans: a) c) The OSI Reference Model.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.