[ https://issues.apache.org/jira/browse/OFBIZ-3985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920305#action_12920305 ]
Adrian Crum commented on OFBIZ-3985: ------------------------------------ This type of design pattern is useful in scenarios where the constant's value is unknown, or it should be hidden from client code. A typical example is a magic number (the java.util.Calendar integers come to mind). I don't think the use case in this issue is a good application of the pattern. > 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 > 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. - You can reply to this email to add a comment to the issue online.