[
https://issues.apache.org/jira/browse/OFBIZ-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taher Alkhateeb updated OFBIZ-6783:
-----------------------------------
Attachment: OFBIZ-6783.patch
This is a new big patch, and all tests run from my side. I made big changes and appreciate your feedback. What I've done is the following:
- separate the AdminPortThread into a new class
- delete CommonsDaemonStart
- refactor everything so that all dependencies between classes are explicit through function calls (no hidden state or declarations)
- move all the server processing logic (status, shutdown, start ...) to a new class called StartupControlPanel. All methods in this class are static with side effects only limited to the arguments passed to them.
- add a few missing apache copyright headers
- refactoring some names to make them clearer
I know this is a big scary patch. But it makes reasoning about the code easier, and the next step is to fully refactor StartupControlPanel.start(...) to make it clean and efficient. But the main benefit of this patch is tangling all the dependency mess that used to exist.
I look forward to hearing from you on this.
> Refactor the start component
> ----------------------------
>
> Key: OFBIZ-6783
> URL:
https://issues.apache.org/jira/browse/OFBIZ-6783> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Upcoming Branch
> Reporter: Taher Alkhateeb
> Assignee: Taher Alkhateeb
> Labels: framework, main, refactoring, start
> Attachments: OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, StartCommandUtil.java
>
>
> Looking at the main method and design of Start.java and the start component overall looks ugly. The things I would like to fix so far are:
> - the files are too long
> - some variables are not even needed (loaderArgs?)
> - the level of abstraction is wrong
> - main throws an exception!
> - the arguments processing logic is terrible, need to move it to commons-cli
> It's just so messy and ugly to look at. So for me refactoring starts at Start! Given that this is an important component, I will provide a patch to be reviewed by the community before committing just to be on the safe side.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)