1. Trang chủ
  2. » Giáo Dục - Đào Tạo

041 section3flashcards kho tài liệu training

30 72 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 30
Dung lượng 369,09 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Is the Dependency Inversion Principle the same as Dependency Injection?... While Dependency Injection refers to the injection of Dependencies into a class... Which type of Dependency Inj

Trang 1

Each Question will be displayed for 10 seconds

If you need more time, just press pause

Trang 2

Who is the original author of the

SOLID Principles of OOP?

Trang 3

Robert “Uncle Bob” Martin

Trang 4

What principle is the ’S’ in

SOLID?

Trang 5

Single Responsibility Principle

Trang 6

Is the Dependency Inversion Principle the same as Dependency

Injection?

Trang 7

No, Dependency Inversion addresses abstractions While Dependency Injection refers

to the injection of Dependencies into a class.

Trang 8

What are the three types of

Dependency Injection

Trang 9

• By Property

• By Setter

• By Constructor

Trang 10

Which type of Dependency Injection should you favor?

Trang 11

By Constructor - This requires the dependency to be injected when the

class is instantiated

Trang 12

Can you use Dependency Injection against a private property in Spring?

Trang 13

Yes, Spring will support this, and inject the

dependency using reflection at runtime

However, this is considered a VERY bad

practice.

Trang 14

Is it good practice to use concrete classes for dependency injection?

Trang 15

No You should use interfaces, which will allow the runtime environment to determine the implementation to inject.

Trang 16

What is IoC?

Trang 17

Inversion of Control - the runtime environment (or framework) which

injects dependencies

Trang 18

What is the ‘L’ in SOLID?

Trang 19

Liskov Substitution Principle, by

Barbara Liskov

Trang 20

What is the annotation used in Spring to indicate you want a

dependency injected?

Trang 21

@Autowired

Trang 22

If you have two beans of the same

type, how do you specify a preference for one over the other?

Trang 23

The @Primary annotation can be used to designate a primary bean

Trang 24

What are the two callback interfaces

you can implement to tap into the

bean lifecycle?

Trang 25

InitializingBean and

DisposableBean

Trang 26

What two annotations can be used

to access the Spring Bean lifecycle?

Trang 27

@PostContstuct and

@PreDestroy

Trang 28

How do you specify a bean

name you want injected?

Trang 29

Use the @Qualifier annotation

Ngày đăng: 17/11/2019, 08:18

TỪ KHÓA LIÊN QUAN