Hi,
so in Spring the Controller is afaik similar to the Action in Struts.
The Methods that are called at the Controller annotated class with the
RequestMapping annotations usually return a ModelMap that contains the
data which is usually then rendered by the jsp/jstl files.
If I remember it correctly from the Flex/GraniteDS site you call
[In]
public var fooController:Component;
......
fooController.bar();
.....
if you have on the Spring site a controller like this:
@Controller
public class FooController{
@RequestMapping("/foo/bar")
public ModelMap foo(){
ModelMap mm = new ModelMap();
//...fill mm....
return mm;
}
}
(I think the "Foo"Controller name forces the /"foo"/.... mapping, but
not sure on that anymore)
The Service annotated classes in Spring represent the buisness logic
components and since you don't want to actually think about a "web mvc
requestmapping" layer between your granite/flex client and your
backend, I think the Service classes are the more desired approach.
So you define a class
@Serivce
public class FooService {
public void doLogicStuff(){
}
public void createBar(Bar b){
}
}
Another advantage of that is that the GraniteDS builder plugin for
eclipse generates you as3 proxies for these services, that make
programming just more enjoyable :)
so than you can do stuff like that on the granite/flex site:
[Inject]
public var fooService:FooService;
....
fooService.doLogicStuff();
.....or
var b = new Bar();
fooService.createBar(b);
.....
I think the only reason why you may use controllers is, if you want to
take advantage of Granite's PagedQuery Class.
HIH
max