0 Replies Latest reply on Apr 4, 2017 1:36 AM by Bruno Frascino

    Resteasy and business layer how to integrate them?

    Bruno Frascino Newbie

      Hello,

       

      I am planning to implement my application with the following layers:

       

      Client -> REST(Resteasy) -> Business Logic Layer -> Data access layer -> DB

       

      I am using Wildfly 10.1.0.Final

       

      I am just confused on how the Business layer should be implemented in order to be injected, if so, into the REST service layer....

       

      At the moment I have this:

       

      @Path("/hello")
      @Produces({ "application/json" })
      @Consumes({ "application/json" })
      public class HelloWorld {
        public HelloWorld() {} 
      
        @GET
        @Path("/world")
        public Message getHello(){
          return new Message("Hello World!!"); 
        }
      

       

       

      Message class is not an Entity at the moment, can I just use my entities as the return type?

       

      I am planning to implement my business layer using CDI Managed Beans, so for example if I have a business class MessageService , should I inject it inside my REST class HelloWorld ?

       

      Is there some documentation, article or tutorial that can guide?

       

      Thanks