[
https://issues.apache.org/jira/browse/OFBIZ-9488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16207158#comment-16207158 ]
Jacques Le Roux commented on OFBIZ-9488:
----------------------------------------
Hi Yash, Deepak,
What is the advantage of using a Builder over a Constructor to create a locale? I see none reading the [Creating a Locale|
https://docs.oracle.com/javase/tutorial/i18n/locale/create.html] section. I even find Constructors easier, maybe for readability?
> Usage of factory method or Builder pattern for Locale object creation and usage.
> --------------------------------------------------------------------------------
>
> Key: OFBIZ-9488
> URL:
https://issues.apache.org/jira/browse/OFBIZ-9488> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: 16.11.03
> Reporter: Pradhan Yash Sharma
> Assignee: Deepak Dixit
> Priority: Minor
> Fix For: Upcoming Release
>
> Attachments: OFBIZ-9488.patch, OFBIZ-9488.patch
>
>
> Usage of factory method or Builder pattern for Locale object creation and usage.
> Locale aLocale = Locale.forLanguageTag("en-US");
> Locale bLocale = new Locale.Builder().setLanguage("en").setRegion("US").build();
>
https://docs.oracle.com/javase/tutorial/i18n/locale/index.html> There are many instances on which new Locale() is used instead of this we can use UtilMisc.ensureLocale()
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)