Thursday, October 16, 2008

Aggregate data when calling methods

A mistake that we all do is, when calling a method we don't aggregagte data.

Eg:

If we have a method to save a customer with Customer Name, Address, Telephone No etc... Please avoid writring the code as follows:

public void saveCustomer(String customerName, String address, String telephoneNumber){}

In the above case, it requires to create three memory objects. Instead use an aggregated object to improve local and distributed performance.

public void saveCustomer(Customer customer){}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home