Hi Sharan, Thank you for taking the lead, much appreciated! I urge anyone in the community who is interested to pitch in. We need everyone's help as the code base really needs a _lot_ of cleanup work.
I would like to stress that not all refactoring is hard, and you don't need to turn everything into a big object framework. Little help here and there would go a long way. For those interested, I've compiled below some common "Code Smells" which you can quickly identify and fix in the framework: - Obsolete / irrelevant comments: anything out of date - Commented out code: that sucks, it belongs in the version control system - functions with too many arguments: anything beyond 3 arguments is probably too much unless there is a good reason for it. - functions that do too many things - multiple languages in the same text file - Big files / Big classes / Big anything really! - Duplication and cut-and-paste patterns - Mixed levels of abstraction: You can't declare high level stuff like starting the framework with details like flag parsing in the same place. Things should read like a story from high level down to the details. Main calls higher level functions which then call lower functions which executes detailed code. - Any concrete class not implementing an interface is probably a code smell, especially if too many dependencies point to it. - cluttered code, sandwiched in an ugly way - Pretty much all the Java warnings in the current code base - too much use of the "new" keyword instead of having a proper factory - writing to classes instead of interfaces - Confusing names for classes, functions, and variables. Things should be very clear and simple - Confusing test names - Lack of testing for any production code. Ideally, our tests should cover 100% of the code base. - inconsistent formatting conventions. Tabs instead of spaces, wrong number of spaces for indentation, and so on - Also, one of the worst things I usually encounter is hidden state. For example, you get hidden state in a Java class if the constructor declares a field that was not passed into the constructor. It makes the declaration hidden and the dependency obscure. Please consider helping out! Regards, Taher Alkhateeb -----Original Message----- From: Sharan-F [mailto:sharan.f...@gmail.com] Sent: 01 March 2016 20:09 To: dev@ofbiz.apache.org Subject: Framework Re-Factor: List of Areas that Need Work Hi All A few weeks ago we talked about getting things moving on some framework re-factoring. http://ofbiz.135035.n4.nabble.com/Framework-Cleanup-Options-Tidy-Up-amp-Refa ctor-tt4676797.html#a4676841 One of the things I thought would be useful is to have a list of areas that people could work on. It could also help to focus people on specific tasks and help collaboration so I've setup a wiki page with some background about what we'd like to do and why. https://cwiki.apache.org/confluence/display/OFBIZ/Framework+Re-factor The overall goal is to make it easier for us to maintain and improve our code. Ideally re-factoring occurs naturally over time. In our case I think we need to actively do some maintenance to kick start that process. You will see that I've taken Taher's original suggestions and selected some to include in a 'top 5' list of areas that need some work done. 1. EntitySaxReader (If we can change this from a class implementation to an interface implementation then we can get rid of Javalution. This has been hanging around for a while and would be really, really good to tidy up) 2. HtmlFormRenderer (3000 lines of code and the interfaces it implements are also huge ) 3. XmlFormRenderer (XmlFormRenderer does not implement more than half of the methods ) 4. Dependencies on Deprecated Classes / Constructors (Lots of dependencies on deprecated classes / constructors (e.g. HtmlScreenRenderer, FoScreenRenderer) 5. Start.java (Taher has been working on this so this is currently in progress under https://issues.apache.org/jira/browse/OFBIZ-6783) If you would like to work on an area but are not sure what the problems are then Taher has said that he is willing to help point out what needs to be done. I hope that people will take a look and select an area to begin working on. We need as much help as we can get. I think that if we can get the work started then we can gain the momentum to continue. Thanks Sharan -- View this message in context: http://ofbiz.135035.n4.nabble.com/Framework-Re-Factor-List-of-Areas-that-Nee d-Work-tp4677565.html Sent from the OFBiz - Dev mailing list archive at Nabble.com.