0 Replies Latest reply: Jun 16, 2013 10:23 AM by user11339468 RSS

    URI get mapped to java methods and hardly to domain objects

    user11339468

      Hi,

      I am unable to understand URI maps to resources. and resources are things or domain objects.Because whenever we write rest ful application most of the URIs get mapped to java methods

      Suppose I have class  Employee

      Since client can not directly access domain objects we expose some service to let clients manipulate object of employee class

      i.e I may not write

      @Path("/emp")
      public class Employee{
      }

      @Path("/employee")
      public class EmplyeeService{
            @GET
            @Path("/{"id"}
      public Emplyee getEmployee(@PathParam("id" int id){
      ............
      }

      }

      [b]So my most of the URIs get mapped to java methods and very few one to domain objects
      Can somebody explain this[/b]

      thanks
      Rupali