I’m working on a springboot API, and was curious what the standard naming convention is for nested objects…
For example, if I have an API which will create a user, then the request object should be named something like UserRequest
however, if a user has an address associated to it, should the nested class simply be named UserAddress
or is UserAddressRequest
more typical?
I am curious, because this user address object should / will only be used in the networking layer, internally the address from the request will be mapped into a different object… So my thought is by adding the Request
suffix on this nested object, it will be clear that the object is ONLY to be used in this one place..
Just a sample class to clarify my code structure:
public class UserRequest {
private String firstName;
private String lastName;
//curious on typical / best naming convention for this nested object..?
private UserAddressRequest userAddress;
//OR
private UserAddress userAddress;
}