Re: Enforce noninstantiability with a private constructor

2016-06-24 Thread Rishi Solanki
Team,

We have started pushing changes into trunk, in case anyone would like to
review then we are keeping it very simple;
- For any class we have an sub ticket with class name.
- On the ticket description we are posting the changes needs to be done,
then discuss and finalize the changes.
- Upload the patch with same finalized changes and edit the ticket's
description accordingly.

If you would like to review, then commit, patch and ticket description all
are same so that can be reviewed easily. Thanks!


Rishi Solanki
Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com

On Sat, Jun 18, 2016 at 7:56 PM, Rishi Solanki <rishisolan...@gmail.com>
wrote:

> Moving thread to dev list.
>
> All, we have started effort on this under OFBIZ-7272. In that effort we
> found some classes isn't in use. Once completed this effort we will share
> them for discussion so that we can decide weather to keep them in OFBiz or
> we are good to remove them.
>
>
> --
> Rishi Solanki
> Manager, Enterprise Software Development
> HotWax Systems Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxsystems.com
>
> -- Forwarded message --
> From: Rishi Solanki <rishisolan...@gmail.com>
> Date: Fri, Jun 10, 2016 at 7:40 PM
> Subject: Re: Enforce noninstantiability with a private constructor
> To: ofbizuser <u...@ofbiz.apache.org>
>
>
> Taher,
>
> Thank you very much for your inputs. I was thinking to do the same to add
> private constructors first then do other things. But after your reply I
> think better to pick one class at a time, and check everything for that
> class which includes removing public modifiers, method and fields. Marking
> classes members as final and all your suggestions.
>
> We would start picking classes one by one, and check all its references
> and finally make necessary changes for each class. In that way we would be
> able to match the classes with purpose. This is better way to fix this
> design flaw.
>
> Thanks!
>
>
> Rishi Solanki
> Manager, Enterprise Software Development
> HotWax Systems Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxsystems.com
>
> On Fri, Jun 10, 2016 at 5:00 PM, Taher Alkhateeb <
> slidingfilame...@gmail.com> wrote:
>
>> Hi Rishi,
>>
>> I would suggest when refactoring such classes to apply everything that has
>> to do with visibility including:
>> - Removing public modifiers if not needed on class, method, and field
>> levels
>> - adding private where appropriate
>> - marking classes, methods and fields as final where appropriate
>> - marking method arguments as final where appropriate
>>
>> So I would consider a private constructor to be just one of a suite of
>> activites that I call them collectively as visibility and mutability which
>> are important to provide real isolation between the components with
>> minimal
>> dependencies.
>>
>> My 2 cents
>>
>> Taher Alkhateeb
>>
>> On Fri, Jun 10, 2016 at 2:22 PM, Rishi Solanki <rishisolan...@gmail.com>
>> wrote:
>>
>> > Dear All,
>> >
>> > In past we did same for CatalogWorker, ProductWorker, CategoryWorker,
>> and
>> > UtilMisc classed. Now I think for all the utility, worker, helper
>> classes
>> > having only static members are eligible to have an private constructor
>> with
>> > them to make them non instantiable from anywhere.
>> >
>> > We have log an JIra and added patch for the same. So requesting you to
>> take
>> > a look at OFBIZ-7272 for more details and share your feedback in case we
>> > can do the same for more classes or if any classes we have added should
>> not
>> > be in list.
>> >
>> > Thanks for your help in advance.
>> >
>> >
>> > Rishi Solanki
>> > Manager, Enterprise Software Development
>> > HotWax Systems Pvt. Ltd.
>> > Direct: +91-9893287847
>> > http://www.hotwaxsystems.com
>> >
>>
>
>
>


Fwd: Enforce noninstantiability with a private constructor

2016-06-18 Thread Rishi Solanki
Moving thread to dev list.

All, we have started effort on this under OFBIZ-7272. In that effort we
found some classes isn't in use. Once completed this effort we will share
them for discussion so that we can decide weather to keep them in OFBiz or
we are good to remove them.


--
Rishi Solanki
Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com

-- Forwarded message --
From: Rishi Solanki <rishisolan...@gmail.com>
Date: Fri, Jun 10, 2016 at 7:40 PM
Subject: Re: Enforce noninstantiability with a private constructor
To: ofbizuser <u...@ofbiz.apache.org>


Taher,

Thank you very much for your inputs. I was thinking to do the same to add
private constructors first then do other things. But after your reply I
think better to pick one class at a time, and check everything for that
class which includes removing public modifiers, method and fields. Marking
classes members as final and all your suggestions.

We would start picking classes one by one, and check all its references and
finally make necessary changes for each class. In that way we would be able
to match the classes with purpose. This is better way to fix this design
flaw.

Thanks!


Rishi Solanki
Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com

On Fri, Jun 10, 2016 at 5:00 PM, Taher Alkhateeb <slidingfilame...@gmail.com
> wrote:

> Hi Rishi,
>
> I would suggest when refactoring such classes to apply everything that has
> to do with visibility including:
> - Removing public modifiers if not needed on class, method, and field
> levels
> - adding private where appropriate
> - marking classes, methods and fields as final where appropriate
> - marking method arguments as final where appropriate
>
> So I would consider a private constructor to be just one of a suite of
> activites that I call them collectively as visibility and mutability which
> are important to provide real isolation between the components with minimal
> dependencies.
>
> My 2 cents
>
> Taher Alkhateeb
>
> On Fri, Jun 10, 2016 at 2:22 PM, Rishi Solanki <rishisolan...@gmail.com>
> wrote:
>
> > Dear All,
> >
> > In past we did same for CatalogWorker, ProductWorker, CategoryWorker, and
> > UtilMisc classed. Now I think for all the utility, worker, helper classes
> > having only static members are eligible to have an private constructor
> with
> > them to make them non instantiable from anywhere.
> >
> > We have log an JIra and added patch for the same. So requesting you to
> take
> > a look at OFBIZ-7272 for more details and share your feedback in case we
> > can do the same for more classes or if any classes we have added should
> not
> > be in list.
> >
> > Thanks for your help in advance.
> >
> >
> > Rishi Solanki
> > Manager, Enterprise Software Development
> > HotWax Systems Pvt. Ltd.
> > Direct: +91-9893287847
> > http://www.hotwaxsystems.com
> >
>


[jira] [Commented] (OFBIZ-7272) Enforce noninstantiability with a private constructor to all Utility classes

2016-06-17 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-7272:


This is a good initiative, thanks guys!

> Enforce noninstantiability with a private constructor to all Utility classes
> 
>
> Key: OFBIZ-7272
> URL: https://issues.apache.org/jira/browse/OFBIZ-7272
> Project: OFBiz
>  Issue Type: Improvement
>  Components: ALL COMPONENTS
>Affects Versions: Trunk
>Reporter: Rishi Solanki
> Attachments: OFBIZ-7272.patch
>
>
> I have discusses this in past on mailing list, that Utility, helper, worker 
> classes which contains only static methods should not be instantiable. Also 
> we can restrict it by adding a private constructor.
> Currently OFBiz has many such classes which should have private constructor. 
> Identify all the *Worker.java, *.Helper.java, and *Util.java which do not 
> have any non static method/member are eligible for having a private 
> constructor.
> Reference why we should do this : 
> http://www.informit.com/articles/article.aspx?p=1216151=4



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (OFBIZ-7272) Enforce noninstantiability with a private constructor to all Utility classes

2016-06-17 Thread Rishi Solanki (JIRA)

 [ 
https://issues.apache.org/jira/browse/OFBIZ-7272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rishi Solanki updated OFBIZ-7272:
-
Summary: Enforce noninstantiability with a private constructor to all 
Utility classes  (was: Enforce noninstantiability with a private constructor)

> Enforce noninstantiability with a private constructor to all Utility classes
> 
>
> Key: OFBIZ-7272
> URL: https://issues.apache.org/jira/browse/OFBIZ-7272
> Project: OFBiz
>  Issue Type: Improvement
>  Components: ALL COMPONENTS
>Affects Versions: Trunk
>Reporter: Rishi Solanki
> Attachments: OFBIZ-7272.patch
>
>
> I have discusses this in past on mailing list, that Utility, helper, worker 
> classes which contains only static methods should not be instantiable. Also 
> we can restrict it by adding a private constructor.
> Currently OFBiz has many such classes which should have private constructor. 
> Identify all the *Worker.java, *.Helper.java, and *Util.java which do not 
> have any non static method/member are eligible for having a private 
> constructor.
> Reference why we should do this : 
> http://www.informit.com/articles/article.aspx?p=1216151=4



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (OFBIZ-7272) Enforce noninstantiability with a private constructor

2016-06-10 Thread Chinmay Patidar (JIRA)
framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java
framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java
framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java
framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java
framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java
framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java
framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java
framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java
framework/webtools/src/org/ofbiz/webtools/UtilCacheEvents.java
framework/widget/src/org/ofbiz/widget/content/WidgetContentWorker.java
framework/widget/src/org/ofbiz/widget/content/WidgetDataResourceWorker.java
framework/widget/src/org/ofbiz/widget/portal/WidgetPortalPageWorker.java
framework/widget/src/org/ofbiz/widget/renderer/UtilHelpText.java
specialpurpose/birt/src/org/ofbiz/birt/BirtWorker.java
specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java
specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java
specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java
{code}

> Enforce noninstantiability with a private constructor
> -
>
> Key: OFBIZ-7272
> URL: https://issues.apache.org/jira/browse/OFBIZ-7272
> Project: OFBiz
>  Issue Type: Improvement
>  Components: ALL COMPONENTS
>Affects Versions: Trunk
>Reporter: Rishi Solanki
> Attachments: OFBIZ-7272.patch
>
>
> I have discusses this in past on mailing list, that Utility, helper, worker 
> classes which contains only static methods should not be instantiable. Also 
> we can restrict it by adding a private constructor.
> Currently OFBiz has many such classes which should have private constructor. 
> Identify all the *Worker.java, *.Helper.java, and *Util.java which do not 
> have any non static method/member are eligible for having a private 
> constructor.
> Reference why we should do this : 
> http://www.informit.com/articles/article.aspx?p=1216151=4



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (OFBIZ-7272) Enforce noninstantiability with a private constructor

2016-06-10 Thread Rishi Solanki (JIRA)

 [ 
https://issues.apache.org/jira/browse/OFBIZ-7272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rishi Solanki updated OFBIZ-7272:
-
Description: 
I have discusses this in past on mailing list, that Utility, helper, worker 
classes which contains only static methods should not be instantiable. Also we 
can restrict it by adding a private constructor.

Currently OFBiz has many such classes which should have private constructor. 
Identify all the *Worker.java, *.Helper.java, and *Util.java which do not have 
any non static method/member are eligible for having a private constructor.

Reference why we should do this : 
http://www.informit.com/articles/article.aspx?p=1216151=4

  was:
I have discusses this in past on mailing list, that Utility, helper, worker 
classes which contains only static methods should not be instantiable. Also we 
can restrict it by adding a private constructor.

Currently OFBiz has many such classes which should have private constructor. 
Identify all the *Worker.java, *.Helper.java, and *Util.java which do not have 
any non static method/member are eligible for having a private constructor.


> Enforce noninstantiability with a private constructor
> -
>
> Key: OFBIZ-7272
> URL: https://issues.apache.org/jira/browse/OFBIZ-7272
> Project: OFBiz
>  Issue Type: Improvement
>  Components: ALL COMPONENTS
>Affects Versions: Trunk
>Reporter: Rishi Solanki
>
> I have discusses this in past on mailing list, that Utility, helper, worker 
> classes which contains only static methods should not be instantiable. Also 
> we can restrict it by adding a private constructor.
> Currently OFBiz has many such classes which should have private constructor. 
> Identify all the *Worker.java, *.Helper.java, and *Util.java which do not 
> have any non static method/member are eligible for having a private 
> constructor.
> Reference why we should do this : 
> http://www.informit.com/articles/article.aspx?p=1216151=4



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (OFBIZ-7272) Enforce noninstantiability with a private constructor

2016-06-09 Thread Rishi Solanki (JIRA)
Rishi Solanki created OFBIZ-7272:


 Summary: Enforce noninstantiability with a private constructor
 Key: OFBIZ-7272
 URL: https://issues.apache.org/jira/browse/OFBIZ-7272
 Project: OFBiz
  Issue Type: Improvement
  Components: ALL COMPONENTS
Affects Versions: Trunk
Reporter: Rishi Solanki


I have discusses this in past on mailing list, that Utility, helper, worker 
classes which contains only static methods should not be instantiable. Also we 
can restrict it by adding a private constructor.

Currently OFBiz has many such classes which should have private constructor. 
Identify all the *Worker.java, *.Helper.java, and *Util.java which do not have 
any non static method/member are eligible for having a private constructor.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)