Hello Patrik, servlet in my Smartclient is doing JSON conversion to JavaBeans and making calls to service layer (little bit smartclient specific). I was looking for some standard solutions but I have to write it manually because I found that no standard solution could recognize associations and aggregations. When you have relation you have to know or better to say system have to know if relation is of association or aggregation type. Simple service externalization isn't enough. For now I'm recognizing it only if service is generated for related entity. If not is aggregation, if yes than is association. Maybe we should introduce something do DSL which allow us to specify type of relation. Or maybe you already have some solution for this and I'm totally out of topic.
Best will be to make some integration DSL where we can compose services and base it on some existing ESB (e.g. ServiceMix) and provide as many different interfaces and transport protocols as possible. At begging we should start without DSL but integrate ServiceMix4 to environment and generate default configuration which will just bridge (externalize) services. This will be very useful for me (and I hope also for others). ServiceMix4 is base for FuseESB and Eclipse Swordfish. It's best choice for ESB. Best regards Pavel On Fri, Sep 11, 2009 at 10:30 PM, Patrik Nordwall <patrik.nordw...@gmail.com> wrote: > > Hi all, I have an idea of a new feature and would like to have your input. > > When we have evaluated Google App Engine we have used the new REST features > in Spring 3.0. REST is a perfect style for the cloud and I think it would be > rather easy to generate the Spring Controllers, delegating to Services. I'm > not looking for another gui solution. It should primarily support json and > xml content, which can be used by various client applications (not only > cloud environment). > > My suggestion is to generate Spring Controllers with @RequestMapping > annotations. The methods should delegate to Service methods, or be > implemented by hand written code in gap subclass. > > It might look something like this: > > �...@requestmapping(value = "/inquiry/{id}", method = RequestMethod.GET) > public String show(@PathVariable("id") Long id, ModelMap modelMap) > throws InquiryNotFoundException { > Key inquiryKey = KeyFactory.createKey(Inquiry.class.getSimpleName(), > id); > Inquiry inquiry = inquiryService.findById(serviceContext(), > inquiryKey); > modelMap.put("inquiry", inquiry); > return "inquiry/show"; > } > > �...@requestmapping(value = "/inquiry", method = RequestMethod.POST) > public String create(@ModelAttribute("inquiry") Inquiry inquiry, > BindingResult result) { > if (inquiry == null) { > throw new IllegalArgumentException("A inquiry is required"); > } > Inquiry savedInquiry = inquiryService.save(serviceContext(), > inquiry); > return "redirect:/rest/inquiry/" + savedInquiry.getId().getId(); > } > > > What I think should be done: > - In meta model add Controller and ControllerOperation, similar to Service. > ControllerOperation should include things necessary to define RequestMapping > and delegation to ServiceOperation. > - In DSL add DslController similar to DslService > - In transformation add transformaton from DslController to Controller > - In transformation add scaffold for controller, similar to Service, i.e. > the CRUD operations can be automated using single scaffold keyword > - Generation template for Controller and its operations. Support for gap > class. > - Generation template for spring configuration for > ContentNegotiatingViewResolver > > References: > - http://www.infoq.com/articles/designing-restful-http-apps-roth > - http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc > - > http://stsmedia.net/spring-finance-part-7-adding-support-for-json-and-xml-views/ > http://code.google.com/p/spring-finance-manager/source/checkout > I have tried the setup described here and I think it is working. > - http://curl.haxx.se/ (useful for testing) > > What do you thing? Would this be useful for you? > > /Patrik > > > -- > View this message in context: > http://www.nabble.com/-sculptor--RESTful-Services-tp25407858s17564p25407858.html > Sent from the Fornax-Platform mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Fornax-developer mailing list > Fornax-developer@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fornax-developer > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Fornax-developer mailing list Fornax-developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fornax-developer