[forge-dev] [JBoss JIRA] Commented: (SEAMFORGE-79) When using the new-field command, the getters and setters should be separated from the field to make it more readable.

Dan Allen (JIRA) jira-events at lists.jboss.org
Mon Mar 21 11:14:48 EDT 2011


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

Dan Allen commented on SEAMFORGE-79:
------------------------------------

I don't like the idea of having section markers either. I consider that "developer intrusion" into the file (similar to "author intrusion" in a novel). It's just excess information.

Having said that, I recognize that forge is a tool for creating code the way you like it. Thus, I wouldn't be against an option to have such intrusive comments added. Forge is certainly smart enough to know where to put them, having comprehension of the file.

Btw, a question I see between the lines here is that forge should format the code, or some portion of it. Code formatting is not always desired, as it can mess up diffs in VCS systems, though when laying down brand new code, it certainly applies. If it's possible to have newly inserted sections of the code formatted according the to user's preferences (like Eclipse does), that would be ideal. (Ignore if it already does this).

> When using the new-field command, the getters and setters should be separated from the field to make it more readable.
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: SEAMFORGE-79
>                 URL: https://issues.jboss.org/browse/SEAMFORGE-79
>             Project: Seam Forge
>          Issue Type: Feature Request
>          Components: Brainstorming
>    Affects Versions: 1.0.0.Alpha1, 1.0.0.Alpha2, 1.0.0.Alpha3
>            Reporter: Pablo Martinez
>            Priority: Optional
>
> When using the new-field command, the getters and setters should be separated from the fields, to make the java class more readable after using seamforge.
> An idea is to separate every java class in 4 parts: Field block, Constructor block, Getter/Setter block and Method block, using some arbitrary sintax (for easy parsing maybe?), for example something like:
> {code}
> @Entity
> public class User {
>   /* [FIELDS] */
>   private int id;
>   private String username;
>   private String password;
>   /* [CONSTRUCTORS] */
>   public User() {
>   }
>   public User(String username, String password) {
>   }
>   /* [GETTERS/SETTERS] */
>   public String getUsername() {
>     return this.username;
>   }
>   public void setUsername(final String username) {
>     this.username = username;
>   }
>   //etc...
>   /* [METHODS] */
>   public void doSomething() { }
>   public boolean equals(User other) { return false; }
>   //etc...  
> }
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the forge-dev mailing list