Hello All,
While going through the code in UpsServices.java I have observed that there is a need of improvement in the code written there. Specially it needs to be improved for 2 things: 1. I18n for error and success messages. 2. Putting values in elements which are required for XML must be checked for null values and other wise "" should be sent in the request. Because there may be few fields which are not there in db for a specific record. For #2 there are already checks on few like address2 field form PostalAddress which can be null at any moment. IMO this should also be done for the fields like attnName which can be sometimes null. I want to do those changes to avoid null pointer exceptions which usually comes because of the lack of the information but can be processed with "" without any harm. I also may be wrong here so please correct me if this is the case. There can be few more things. If some of you want to point. Thoughts? Thanks & Regards -- Pranay Pandey HotWax Media | http://www.hotwaxmedia.com |
I agree on both the points, Pranay.
+1 from my side for this improvement. -- Ashish Pranay Pandey wrote: > Hello All, > > While going through the code in UpsServices.java I have observed that > there is a need of improvement in the code written there. > Specially it needs to be improved for 2 things: > > 1. I18n for error and success messages. > 2. Putting values in elements which are required for XML must be > checked for null values and other wise "" should be sent in the > request. Because there may be few fields which are not there in db for > a specific record. > > For #2 there are already checks on few like address2 field form > PostalAddress which can be null at any moment. IMO this should also be > done for the fields like attnName which can be sometimes null. > I want to do those changes to avoid null pointer exceptions which > usually comes because of the lack of the information but can be > processed with "" without any harm. > > I also may be wrong here so please correct me if this is the case. > > There can be few more things. If some of you want to point. > > Thoughts? > > Thanks & Regards > -- > Pranay Pandey > HotWax Media | http://www.hotwaxmedia.com > > smime.p7s (4K) Download Attachment |
In reply to this post by Pranay Pandey-2
the only one at this point is don't depend on the attnName in
PostalAddress, at some point that will be refereence to a contactmech that has the Type attnName that is if my Address rework is accepted. Pranay Pandey sent the following on 6/8/2009 6:20 AM: > Hello All, > > While going through the code in UpsServices.java I have observed that > there is a need of improvement in the code written there. > Specially it needs to be improved for 2 things: > > 1. I18n for error and success messages. > 2. Putting values in elements which are required for XML must be checked > for null values and other wise "" should be sent in the request. Because > there may be few fields which are not there in db for a specific record. > > For #2 there are already checks on few like address2 field form > PostalAddress which can be null at any moment. IMO this should also be > done for the fields like attnName which can be sometimes null. > I want to do those changes to avoid null pointer exceptions which > usually comes because of the lack of the information but can be > processed with "" without any harm. > > I also may be wrong here so please correct me if this is the case. > > There can be few more things. If some of you want to point. > > Thoughts? > > Thanks & Regards > -- > Pranay Pandey > HotWax Media | http://www.hotwaxmedia.com > > -- BJ Freeman http://www.businessesnetwork.com/automation http://bjfreeman.elance.com http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro Systems Integrator. |
As I am always finding myself unable to understand your comments, BJ.
Can you please rephrase your comments for me? Will be of help. :) Thanks & Regards -- Pranay Pandey On Jun 9, 2009, at 1:01 AM, BJ Freeman wrote: > the only one at this point is don't depend on the attnName in > PostalAddress, at some point that will be refereence to a contactmech > that has the Type attnName > that is if my Address rework is accepted. > > Pranay Pandey sent the following on 6/8/2009 6:20 AM: >> Hello All, >> >> While going through the code in UpsServices.java I have observed that >> there is a need of improvement in the code written there. >> Specially it needs to be improved for 2 things: >> >> 1. I18n for error and success messages. >> 2. Putting values in elements which are required for XML must be >> checked >> for null values and other wise "" should be sent in the request. >> Because >> there may be few fields which are not there in db for a specific >> record. >> >> For #2 there are already checks on few like address2 field form >> PostalAddress which can be null at any moment. IMO this should also >> be >> done for the fields like attnName which can be sometimes null. >> I want to do those changes to avoid null pointer exceptions which >> usually comes because of the lack of the information but can be >> processed with "" without any harm. >> >> I also may be wrong here so please correct me if this is the case. >> >> There can be few more things. If some of you want to point. >> >> Thoughts? >> >> Thanks & Regards >> -- >> Pranay Pandey >> HotWax Media | http://www.hotwaxmedia.com >> >> > > -- > BJ Freeman > http://www.businessesnetwork.com/automation > http://bjfreeman.elance.com > http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro > Systems Integrator. > |
In reply to this post by BJ Freeman
You are not a lone, and it is something I have found through my life.
let me try again. The Attname in the postal address is not part of the Data model from the Books. I am working to add functionality to the Postal address http://docs.ofbiz.org/display/OFBIZ/Extending+PostalAddress+Information when and if this is implemented in ofbiz Attnname will not be in the Postal address Entity. instead there will be a link to a Contact mech that has the persons name and the type ATTNNAME or some sort. hope that is clearer. Pranay Pandey sent the following on 6/9/2009 2:53 AM: > As I am always finding myself unable to understand your comments, BJ. > Can you please rephrase your comments for me? Will be of help. :) > > Thanks & Regards > -- > Pranay Pandey > > On Jun 9, 2009, at 1:01 AM, BJ Freeman wrote: > >> the only one at this point is don't depend on the attnName in >> PostalAddress, at some point that will be refereence to a contactmech >> that has the Type attnName >> that is if my Address rework is accepted. >> >> Pranay Pandey sent the following on 6/8/2009 6:20 AM: >>> Hello All, >>> >>> While going through the code in UpsServices.java I have observed that >>> there is a need of improvement in the code written there. >>> Specially it needs to be improved for 2 things: >>> >>> 1. I18n for error and success messages. >>> 2. Putting values in elements which are required for XML must be checked >>> for null values and other wise "" should be sent in the request. Because >>> there may be few fields which are not there in db for a specific record. >>> >>> For #2 there are already checks on few like address2 field form >>> PostalAddress which can be null at any moment. IMO this should also be >>> done for the fields like attnName which can be sometimes null. >>> I want to do those changes to avoid null pointer exceptions which >>> usually comes because of the lack of the information but can be >>> processed with "" without any harm. >>> >>> I also may be wrong here so please correct me if this is the case. >>> >>> There can be few more things. If some of you want to point. >>> >>> Thoughts? >>> >>> Thanks & Regards >>> -- >>> Pranay Pandey >>> HotWax Media | http://www.hotwaxmedia.com >>> >>> >> >> -- >> BJ Freeman >> http://www.businessesnetwork.com/automation >> http://bjfreeman.elance.com >> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro >> >> Systems Integrator. >> > > -- BJ Freeman http://www.businessesnetwork.com/automation http://bjfreeman.elance.com http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro Systems Integrator. |
Free forum by Nabble | Edit this page |