Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Passing an object between the methods which has to keep adding data in all the methods.
janardhan jdev
Greenhorn
Posts: 1
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I have a requirement of passing the object between methods and adding data as below example. Is the below written code is a good programming practice?
public void parentMethod(){ PropertyBean propertyBean = new PropertyBean(); propertyBean.SetValue1("Value1"); propertyBean = childMethod(propertyBean); propertyBean.SetValue3("Value3"); } public PropertyBean childMethod(PropertyBean propertyBean){ propertyBean.SetValue2("Value2"); return propertyBean; }
Janardhan
Liutauras Vilda
Marshal
Posts: 8857
637
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
No.
1. Bad code indentation
2. Badly named methods (all), such as "SetValue1", it is meaningless as well as doesn't follow naming convention... first lower case... every other
word
camel case.
3. No spaces in between successive methods.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JSF and DB2 interaction
Reference Variable to object diagram - Karty n Bert
Achieving inheritance without extends
Problem while posting data from a servlet.
Collections problem
More...