Best way to specify fields returned by a Service
问题 We're using Java EE 7 with WildFly 9 to develop the custom backend for a mobile/web application. The backend is a classic 3-tier system, with communication logic (JAX-RS), business logic (Session EJBs) and persistence layer (Hibernate). The business logic layer is composed by a set of services, each defined by an interface and an EJB implementation. Let's suppose public interface IPostService { List<PostDTO> getAllPosts(); } and @Stateless public class PostService implements IPostService {