[forge-issues] [JBoss JIRA] (FORGE-2109) Refactoring the UICommands

Antonio Goncalves (JIRA) issues at jboss.org
Wed Oct 29 19:25:35 EDT 2014


    [ https://issues.jboss.org/browse/FORGE-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015951#comment-13015951 ] 

Antonio Goncalves commented on FORGE-2109:
------------------------------------------

I'm not suggesting to remove the interfaces, I just wonder why some commands have interfaces and others don't. I would like to find a "pattern" on writing commands and apply it all over the place. If you say that interfaces are useful for addons, let's add interfaces.

> Refactoring the UICommands
> --------------------------
>
>                 Key: FORGE-2109
>                 URL: https://issues.jboss.org/browse/FORGE-2109
>             Project: Forge
>          Issue Type: Enhancement
>          Components: UI - API
>    Affects Versions: 2.12.1.Final
>            Reporter: Antonio Goncalves
>         Attachments: UIForgeNow.png, UIForgeRefactor.png, UIForgeStructure.png
>
>
> _From the Mailing List [https://developer.jboss.org/thread/249733]_
> I'm trying to add more commands in Forge... but I have to say, I'm a bit lost. So, I've made a quick UML class diagram. 
> As you can see in the attached diagram (UIForgeNow.png), most of the Java EE commands extend {{AbstractJavaEECommand}}, which makes sense. But not all of them ({{NewBeanCommand}} (CDI), {{ValidationNewAnnotationCommandImpl}}, {{NewQualifierCommand}}....). And some times you have an extra level of abstraction ({{AbstractFacesCommand}}). Same for the Java commands. {{JavaClassCommandImpl}} extend {{AbstractJavaSourceCommand}} but {{JavaAddAnnotationCommand}} and {{JavaFieldCommand}} inherit from {{AbstractProjectCommand}}. Some other commands, just use the {{@Command}} annotation. 
> Then, when you dive into a command (UIForgeStructure.png), some commands use interface and implementation (see in the second diagram {{JavaAddAnnotationCommandImpl}} implementing {{JavaAddAnnotationCommand}}), some don't (e.g. {{NewQualifierCommand}}). 
> Correct me if I'm wrong, but the way I see it would be (UIForgeRefactor.png) : under {{AbstractJavaEECommand}} you have a set of {{AbstractValidationCommand}}, {{AbstractCDICommand}}, {{AbstractJPACommand}}.... each implementing {{PrerequisiteCommandsProvider}} (this way, each command sets up its own pre-requisite). And then, under {{AbstractCDICommand}} you have all the {{NewQualifierCommand}}, {{NewBeanCommand}}....
> *The idea of this JIRA is to brainstorm about refactoring the commands, and see if we do it and how*



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the forge-issues mailing list