There are also 4th and 5th options :-)
4) Turn on the "inflation rate" parameter for the corresponding API calls, for example. getUser (id, inflation). Thus, you delegate responsibility for the selection of which parts of the object sent by wire will be available to the client who will use this object. You can say that the level of intrusion is as coarse or fine as you want. A typical example would be something like BASIC (only the immediate properties are filled), ASSOCIATIONS (basic + direct collections / associations), FULL (the whole hierarchy - all related objects).
5) You can write your own proxy server that supports lazy initialization without interruption. This approach is only possible if related objects (or properties) that are lazy can potentially be huge, but are rarely used (by clients).
Then, of course, there is also Sim as a scaffman mentioned :-)
source share