Agent Config protected data members, and using methods only to be able to override them?

I have found this to be common:
creating any agent/env configuration object, with it’s fields defined as protected, and the only way to access or override their values is through functions, for example:


protected apb_vif_t dut_vif;
protected uvm_active_passive_enum is_active = UVM_ACTIVE;
protected bit has_coverage = 1;

virtual function apb_vif_t get_dut_vif();
	return dut_vif;
	endfunction

virtual function void set_dut_vif(apb_vif_t dut_vif);
	this.dut_vif = dut_vif;
endfunction 

virtual function uvm_active_passive_enum get_is_active();
	return is_active;
endfunction

virtual function void set_is_active(uvm_active_passive_enum is_active);
	this.is_active = is_active;
endfunction
		
virtual function bit get_has_coverage();
	return has_coverage;
endfunction

virtual function void set_has_coverage(bit has_coverage);
	this.has_coverage = has_coverage;
endfunction

I understand protected class members, mean that they are only available to the base and any extended class down the line, and that they aren’t accessed through the dot operator from outside the class, so this method of setting all data to be protected, with individual get and set methods, is considered a safety mechanism to prevent any unauthorized accessing or overriding (no individual set or get)? can someone elaborate on why this structure stands please?

Thank you.

In reply to tonyyalfred:

Accessors and Mutators are part of a common object oriented programming principle that hides implementation details of a base class library.

This might be overkill in a SystemVerilog testbench. For example there is no other way to implement a virtual interface handle. However having a consistent API has its benefits.