[JBoss JIRA] (FORGE-1271) Adding code conventions to generated code
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1271?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III updated FORGE-1271:
--------------------------------------
Affects Version/s: 2.0.0.Alpha14
> Adding code conventions to generated code
> -----------------------------------------
>
> Key: FORGE-1271
> URL: https://issues.jboss.org/browse/FORGE-1271
> Project: Forge
> Issue Type: Feature Request
> Components: Resources API, Scaffold
> Affects Versions: 2.0.0.Alpha14
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> Discussion on : https://community.jboss.org/message/842429
> Developers look at Forge as the "way to write Java EE code" or if you like "if those guys write code like this, then we should".
> I am digging into some details of the generated code (I am writing a blog about several architectural styles starting with Forge) and I feel coding convention should be homogenized. I know extensions are written by different individuals, but some basic coding conventions should be applied. For example, when you generate a web app with REST and Faces scaffolding, you get some difference :
> * Faces Backing Bean use query builder (e.g {{getAll}} method is {{entityManager.createQuery(criteria.select(criteria.from(Book.class))).getResultList();}} and
> * REST Endpoint use dynamic queries (the {{listAll}} method is {{"SELECT DISTINCT b FROM Book b ORDER BY b.id"))}}
> Method names are different and do the same :
> * JSF : {{getAll}}
> * REST : {{listAll}}
> Attributes
> * {{private EntityManager em;}}
> * {{private EntityManager entityManager;}} // em would be better
> Or the use of {{this}} keyword (JSF beans use {{this.entityManager}} instead of directly {{em}} in REST)
> And there are several examples like this. If Forge is seen as "the way of writing code" maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one.....
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years
[JBoss JIRA] (FORGE-1275) @PUT method shouldn't have a @Path
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1275?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III updated FORGE-1275:
--------------------------------------
Fix Version/s: 2.x Future
> @PUT method shouldn't have a @Path
> ----------------------------------
>
> Key: FORGE-1275
> URL: https://issues.jboss.org/browse/FORGE-1275
> Project: Forge
> Issue Type: Bug
> Components: Scaffold
> Affects Versions: 1.4.2.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> Hi,
> In the REST scaffolding, the generate {{update}} method looks like this :
> {code}
> @PUT
> @Path("/{id:[0-9][0-9]*}")
> @Consumes("application/xml")
> public Response update(Book entity) {
> em.merge(entity);
> return Response.noContent().build();
> }
> {code}
> The method has a {{@Path}} annotation with an id and therefore cannot be invoked (without the id that is not used in the method). So it should simply be :
> {code}
> @PUT
> @Consumes("application/xml")
> public Response update(Book entity) {
> em.merge(entity);
> return Response.noContent().build();
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years
[JBoss JIRA] (FORGE-1271) Adding code conventions to generated code
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1271?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III updated FORGE-1271:
--------------------------------------
Affects Version/s: (was: 2.x Future)
> Adding code conventions to generated code
> -----------------------------------------
>
> Key: FORGE-1271
> URL: https://issues.jboss.org/browse/FORGE-1271
> Project: Forge
> Issue Type: Feature Request
> Components: Resources API, Scaffold
> Reporter: Antonio Goncalves
>
> Discussion on : https://community.jboss.org/message/842429
> Developers look at Forge as the "way to write Java EE code" or if you like "if those guys write code like this, then we should".
> I am digging into some details of the generated code (I am writing a blog about several architectural styles starting with Forge) and I feel coding convention should be homogenized. I know extensions are written by different individuals, but some basic coding conventions should be applied. For example, when you generate a web app with REST and Faces scaffolding, you get some difference :
> * Faces Backing Bean use query builder (e.g {{getAll}} method is {{entityManager.createQuery(criteria.select(criteria.from(Book.class))).getResultList();}} and
> * REST Endpoint use dynamic queries (the {{listAll}} method is {{"SELECT DISTINCT b FROM Book b ORDER BY b.id"))}}
> Method names are different and do the same :
> * JSF : {{getAll}}
> * REST : {{listAll}}
> Attributes
> * {{private EntityManager em;}}
> * {{private EntityManager entityManager;}} // em would be better
> Or the use of {{this}} keyword (JSF beans use {{this.entityManager}} instead of directly {{em}} in REST)
> And there are several examples like this. If Forge is seen as "the way of writing code" maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one.....
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years
[JBoss JIRA] (FORGE-1271) Adding code conventions to generated code
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1271?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III updated FORGE-1271:
--------------------------------------
Fix Version/s: 2.x Future
> Adding code conventions to generated code
> -----------------------------------------
>
> Key: FORGE-1271
> URL: https://issues.jboss.org/browse/FORGE-1271
> Project: Forge
> Issue Type: Feature Request
> Components: Resources API, Scaffold
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> Discussion on : https://community.jboss.org/message/842429
> Developers look at Forge as the "way to write Java EE code" or if you like "if those guys write code like this, then we should".
> I am digging into some details of the generated code (I am writing a blog about several architectural styles starting with Forge) and I feel coding convention should be homogenized. I know extensions are written by different individuals, but some basic coding conventions should be applied. For example, when you generate a web app with REST and Faces scaffolding, you get some difference :
> * Faces Backing Bean use query builder (e.g {{getAll}} method is {{entityManager.createQuery(criteria.select(criteria.from(Book.class))).getResultList();}} and
> * REST Endpoint use dynamic queries (the {{listAll}} method is {{"SELECT DISTINCT b FROM Book b ORDER BY b.id"))}}
> Method names are different and do the same :
> * JSF : {{getAll}}
> * REST : {{listAll}}
> Attributes
> * {{private EntityManager em;}}
> * {{private EntityManager entityManager;}} // em would be better
> Or the use of {{this}} keyword (JSF beans use {{this.entityManager}} instead of directly {{em}} in REST)
> And there are several examples like this. If Forge is seen as "the way of writing code" maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one.....
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years
[JBoss JIRA] (FORGE-1296) Allow constraints to be specified on the versions of the Facets during setup
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1296?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III updated FORGE-1296:
--------------------------------------
Fix Version/s: 2.x Future
> Allow constraints to be specified on the versions of the Facets during setup
> ----------------------------------------------------------------------------
>
> Key: FORGE-1296
> URL: https://issues.jboss.org/browse/FORGE-1296
> Project: Forge
> Issue Type: Feature Request
> Components: UI - API
> Affects Versions: 2.0.0.Alpha14
> Reporter: Vineet Reynolds
> Assignee: George Gastaldi
> Fix For: 2.x Future
>
>
> The current implementation of the Scaffold and possibly other addons, verifies if facets are setup and then proceeds to add the wizards for these facets to the NavigationResult.
> It is possible that some of the versions displayed in the individual wizards will not be applicable when used in a composite wizard like the scaffold. We need to find a way for the composite to hint or specify the allowed versions of the individual facets.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years