[jira] [Commented] (OFBIZ-3985) Using seperate class for constants

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-3985) Using seperate class for constants

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-3985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073150#comment-13073150 ]

Jacques Le Roux commented on OFBIZ-3985:
----------------------------------------

The article I referred above is a bad idea. It's actually a known anti pattern and it's better to use [static import|http://download.oracle.com/javase/1,5.0/docs/guide/language/static-import.html]

> Using seperate class for constants
> ----------------------------------
>
>                 Key: OFBIZ-3985
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3985
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL APPLICATIONS
>    Affects Versions: Release Branch 10.04
>            Reporter: Pankaj Savita
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: Release Branch 10.04
>
>         Attachments: Using_Separate_Constant_Class.patch
>
>
> Hi All,
>  
> Why don't we use a separate constant class for defining constants? We can use Parameter Constants Design Pattern in OFBiz.
> Database fields & Form Fields can be defined in a Constant class, So that whenever fields name changed no need
> to search the entire code. Just need to change it in Constant class. It makes easy maintainable code.
>  
> I am attaching a sample patch done in accounting component. In this I used a seperate class for a accounting specific constatns
>  & a common class for OFBiz specific constants.

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