|
From: Chris W. <chr...@me...> - 2006-08-18 00:42:06
|
The problem with this as I see it would be when you start inheriting=20
actions.
There's quite a few 'standard' actions in, for example, the=20
FormController class. These can't be annotated for back compatibility=20
reasons. You'd be left with some slightly funny logic for determining if=20
you should use the 'blessings' or not, for example check if any methods=20
in the class have an annotation, and if they do require it for all, and=20
do this only on a class by class basis up the inheritance chain. This=20
quickly gets confusing when you're dealing with simple action classes=20
with only one action, if there's no annotation there it might well have=20
been forgotten but you use it anyhow, then when someone else adds an=20
action and remembers the annotation the old action method is confusingly=20
broken.
Tomasz B=C5=82achowicz wrote:
> Hi there,
>
> I've been playing around with MultiActionController for a few days. In
> general I really like the idea and the controller seems to very handy.
> There is one thing that I'd enjoy. I was wondering about ability to
> explicitly specify which methods are 'blessed' ones. Currently methods
> are matched using well-defined pattern, but I'd prefer to annotate
> methods using Java SE 5 annotations.
>
> What about such a notation *this is just very simple example/idea*:
>
> @Action
> public ModelAndView doSomething(@Command("myCommand") MyCommand
> command, @Request HttpServletRequest request);
>
> This means that doSoemthing method is 'blessed' one i.e action method,
> first parameter is command object, and second is HTTP request
> instance. Note that we don't have to follow strict rules in signature
> and we have extreme flexibility in defining signatures.
>
> We can define more parameter-level annotations that would pass
> instances as parameters into 'blessed' methods. I'm thinking of
> @Response, @Session, etc.
>
> Please note, this post is just rough idea, but it's worth
> consideration, I believe. Any comments are welcome. I would be pleased
> to discuss this subject in details if anyone is interested.
>
> Regards,
> Tom
>
> -----------------------------------------------------------------------=
--
> Using Tomcat but need to do more? Need to support web services, securit=
y?
> Get stuff done quickly with pre-integrated technology to make your job =
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron=
imo
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
> =20
|