There are many different entities in a web application that interact with each other. An example of such an entity would be "user".
In different parts of the application, a different set of user fields is required. For example, on the user edit page, all fields are required; on the page with the user’s login history, only the identifier, name, and last login date are needed.
If you create one class for a user in an application, then there will be an extra consumption of resources for storing extra fields, filling them, etc. This is especially true if you need to serialize an object in json for transmission to the browser (this is done automatically and the extra fields generate significant traffic).
If you create different classes for different parts of the application, you get a lot of duplication of code; many classes for one entity that are hard to maintain; you have to write additional dao - everything is very inconvenient and somehow wrong.
What approaches exist to support in the application different representations of the same entity in different parts of the application?