Escaping references is a way to protect the data from being polluted.
fx: when returning a list of users from a class; even the list is encapsulated, but the reference to the list may be exposed to external after returning the same list to the external. On the case, the content may be modified by an external process.
There are two ways to escape the reference:
1. not returning an instance reference directly; fx. returning un-modified collections(immutable).
2. using the interface to customise the data model that is only readable.
Subscribe to:
Post Comments (Atom)
Can Jackson Deserialize Java Time ZonedDateTime
Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...
-
The strictfp keyword is used to force the precision of floating point calculations (float or double) in Java conform to IEEE’s 754 standard...
-
In construction. Spring test annotations: @SpringBooTest @DataJpaTest @TestPropertySource @ActiveProfiles @Sql @SpringBootTest It is used f...
-
Testing Controllers @Runwith(SrpingRunner.class) Unit test @Runwith(SrpingRunner.class) @WebMvcTest(SpecificController.class) Integration te...
No comments:
Post a Comment