[forge-issues] [JBoss JIRA] (FORGE-2246) Refactoring the JPA Commands

Antonio Goncalves (JIRA) issues at jboss.org
Wed Feb 18 11:35:49 EST 2015


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

Antonio Goncalves edited comment on FORGE-2246 at 2/18/15 11:35 AM:
--------------------------------------------------------------------

No because we could refactor things in this new {{AbstractJPASourceCommand}}, for example : 

* getMetadata By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
* isProjectRequired (all the JPA commands return true)
* getPrerequisiteCommands (all the JPA commands need a JPA setup)
* Add a method calculateDefaultPackage (all the JPA classes will be, by default, under the .model subpackage)


was (Author: agoncal):
No because we could refactor things in this new {{AbstractJPASourceCommand}}, for example : 

* getMetadata By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
* isProjectRequired
* getPrerequisiteCommands
* Add a method calculateDefaultPackage

> Refactoring the JPA Commands
> ----------------------------
>
>                 Key: FORGE-2246
>                 URL: https://issues.jboss.org/browse/FORGE-2246
>             Project: Forge
>          Issue Type: Sub-task
>          Components: UI - API
>            Reporter: Antonio Goncalves
>            Priority: Minor
>             Fix For: 2.x Future, 3.x Future
>
>
> The idea is to refactor the JPA commands (under {{org.jboss.forge.addon.javaee.jpa.ui}}) :
> * Add an interface with all the default sub-packages in {{javaee-api}}
> ** Interface {{org.jboss.forge.addon.javaee.JavaEEPackages}}
> ** Something like {{BUSINESS_MODEL}} would be {{model}}
> ** {{BUSINESS_LOGIC}} would be {{service}}
> ** {{EXCEPTIONS}} would be {{exception}}
> * Create a new {{org.jboss.forge.addon.javaee.jpa.ui.AbstractJPACommand}} that extends {{AbstractJavaEECommand}} and implements {{PrerequisiteCommandsProvider}}
> ** {{getMetadata}} By adding JPA (and this way each command will be "Java EE / JPA / New Embeddable"
> ** {{isProjectRequired}}
> ** {{getPrerequisiteCommands}}
> ** Add a method {{calculateDefaultPackage}}
> * Refactor the classes
> ** They extend from {{AbstractJPACommand}}
> ** Rename them by prefixing them with {{JPA}}
> *** {{NewEmbeddableCommand}} -> {{JPANewEmbeddableCommand}}
> *** {{NewEntityCommand}} -> {{JPANewEntityCommand}}
> *** ...
> Questions : some classes redifine {{named}} and {{targetPackage}} some don't, why ? : 
> {code}
>    @Inject
>    @WithAttributes(label = "Entity name", description = "The simple name of the generated class", required = true)
>    private UIInput<String> named;
>    @Inject
>    @WithAttributes(label = "Target package", type = InputType.JAVA_PACKAGE_PICKER)
>    private UIInput<String> targetPackage;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the forge-issues mailing list