I
would stick with different many methods using various
arguments:
1.
It's self documenting
2.
It's avoids an ugly switch/if statement in the function
3.
It's more object oriented
4.
Addition/removing of function will not touch existing function/code,
limited change exposure = limited risk
5.
Exceptions thrown might not be the same (you might think of throwing something
better than Exception)
6.
Easier to re-use
7.
With SLSB it performance does not matter, since each request could go to
different bean
8.
It's easier to document.
9. The
code will be easier to understand
10.
Easier to extend
11.
Easier to deprecate
Keep
it simple, keep it easy.
-AP_
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]]On Behalf Of Amarnath P
Sent: Monday, December 10, 2001 10:46 PM
To: [EMAIL PROTECTED]
Subject: help needed !!hi folks,Am using SLSB where am having some of the methods exposed to outside world,public ArrayList getListOfProcess (UserInfo user) throws Exception ;public ArrayList getListOfProcess (SomeObject1 id) throws Exception ;public ArrayList getListOfProcess (SomeObject2 id) throws Exception;where these different solves diff. purpose with same method name and return type anddiff. args. The input argument only differs the kind of request. rather than keeping thesethere different kind of methods, can i have a single method like this,public ArrayList getListOfProcess (Object id, Object typeOfRequest) throws Exception;- where the typeOfRequest identifies the request the user looking for.My query is,1. is this will degrade the peroformance of my Component ? if yes means, how& is there any other way to achive the performance ???2. Is this good way to expose the mothods to outside world ?? (rather than keepingmethods to a single)can anybody throw some light on this...thanks in advance.
________________________________________
Amarnath. P
Trigyn Technologies Limited
Ph: 91- 080 - 5528545 / 5523581-588 Extn: 1154
