[forge-dev] Suggestions for reusing InputComponent's setup

George Gastaldi ggastald at redhat.com
Tue Sep 8 12:07:08 EDT 2015


I created a PR based on this idea. The solution was to introduce decorators
to each input type.

https://github.com/forge/core/pull/585

Comments are welcome!

On Fri, Sep 4, 2015 at 5:04 PM, Lincoln Baxter, III <lincolnbaxter at gmail.com
> wrote:

> I like this suggestion. I think supporting both the Factory and Injection
> point are necessary.
>
> On Fri, Sep 4, 2015 at 1:55 PM, George Gastaldi <ggastald at redhat.com>
> wrote:
>
>> Hello,
>>
>> Antonio Goncalves pointed out in
>> https://issues.jboss.org/browse/FORGE-2331 (also in
>> https://issues.jboss.org/browse/FORGE-2469) that some input
>> configurations could be reused.
>> For example, the targetPackage although is used in several commands, is
>> initialized differently on some commands.
>>
>> What would you think it would be a nice strategy to reuse
>> UIInputComponents?
>>
>> Based on Antonio's suggestions, I have elaborated 2 proposals:
>>
>> 1) Introduce specializations of UIInput:
>>
>> Eg: @Inject private TargetPackage targetPackage;  (Where TargetPackage
>> extends UIInput<String>)
>>
>> More info here:https://gist.github.com/gastaldi/46b3f38bc38c5efcc0ba
>>
>> 2)  Move the component creation to utility classes:
>>
>> eg: @Inject InputFactory factory;
>> and in the initializeUI of the UICommand:
>>
>> targetPackage = factory.createTargetPackage(builder) ;
>>
>> Of course, we could have a mix of both, but I would like to know your
>> thoughts about each proposal.
>>
>> Best Regards,
>>
>> --
>> *George Gastaldi | Senior Software Engineer*
>>
>> JBoss Forge Team
>> T: +55 11 3524-6169
>> M: +55 47 9711-1000
>>
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>
>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>



-- 
*George Gastaldi | Senior Software Engineer*

JBoss Forge Team
T: +55 11 3524-6169
M: +55 47 9711-1000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20150908/b691367a/attachment.html 


More information about the forge-dev mailing list