× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks John.

Note quite understand what you mean on this ==> you should avoid to do
questions different from java-as400 environment
in this list.


"John Arevalo" <johnarevalo@xxxxxxxxx> wrote in message
news:mailman.45523.1306334021.2702.java400-l@xxxxxxxxxxxx...
Hi Hockchai,

you should avoid to do questions different from java-as400 environment
in this list.

Read about immutable objects[1]. Briefly, unless your param be
immutable, every change done over the object, it will be made
effective in the whole scope of the variable, so, you don't need
return the value.

use public void execute(MyObject parm1);

Regards,

[1]http://download.oracle.com/javase/tutorial/essential/concurrency/imstrat.html

On 5/24/11, Hockchai Lim <lim.hock-chai@xxxxxxxxxxxxxxx> wrote:
If I have a method that accept an object as parameter and the main purpose
of this method is to call a backend api and update/add more info into the
object in the parm. In this case, should I directly update that object in
the parm and return void or should I return a object that is the same as
the
parm?

public void execute(MyObject parm1);

or

public MyObject execute(MyObject parm1);




--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing
list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.