[forge-dev] Adding methods to the CommandController

Antonio Goncalves antonio.mailing at gmail.com
Thu Feb 19 08:23:36 EST 2015


Well, you are the boss, I'm just an API user... but would like my life to
be simplified ;o) Of course I can iterate through a map in each of the
tests, but if there was already a method, that would help. Because, in
Roaster, we find this pattern all over the place : getMethods(),
getMethod(String s), hasMethod(Method m), getAnnotations(),
getAnnotation(String s), hasAnnotation(Annotation a).... I find this handy,
and manipulating the CommandController often... well, it helps ;o)

Antonio


2015-02-19 11:13 GMT+01:00 George Gastaldi <ggastald at redhat.com>:

> Hi Antonio,
>
> How different is that from the immutable Map? I find the Map more flexible
> in terms of:
>
> - you can do inputs.keySet() and iterate through the input names (there
> are some places where we do this)
> - some UIProviders need to know if a Command has any input at all to
> decide if it should execute or should render the Wizard screen.
>
> So I am not sure if this is a good idea, but I may be wrong ;)
>
> Best Regards,
>
> George Gastaldi
>
>
>
> Em 19/02/2015, às 07:24, Antonio Goncalves <antonio.mailing at gmail.com>
> escreveu:
>
> Hi all,
>
> I'm investigating how to refactor UICommands in the best way (see the
> analysis in https://issues.jboss.org/browse/FORGE-2109). But before
> refactoring, I would like to add a stronger test coverage so I make sure I
> don't break things.
>
>
> I was looking at CommandController that list of the command inputs :
>
> Map<String, InputComponent<?, ?>> *getInputs*();
>
>
> I would like to add the following commands
>
> InputComponent<?, ?> *getInput*(String input); // returns one input
> boolean *hasInput*(String input); // checks if the input is present
>
>
> What do you think ?
>
> --
> Antonio Goncalves
> Software architect and Java Champion
>
> Web site <http://www.antoniogoncalves.org/> | Twitter
> <http://twitter.com/agoncal> | LinkedIn
> <http://www.linkedin.com/in/agoncal> | Paris JUG
> <http://www.parisjug.org/> | Devoxx France <http://www.devoxx.fr/>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>



-- 
Antonio Goncalves
Software architect and Java Champion

Web site <http://www.antoniogoncalves.org/> | Twitter
<http://twitter.com/agoncal> | LinkedIn <http://www.linkedin.com/in/agoncal>
 | Paris JUG <http://www.parisjug.org/> | Devoxx France
<http://www.devoxx.fr/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20150219/46c53e59/attachment-0001.html 


More information about the forge-dev mailing list