I have many cases where I need to retrieve multiple items from a stateful
object (employee info, user info, etc.).  I can think of 3 ways to 'get' the
data;

1)      A single method that returns all the data in a structured variable,
as in:

                        empData = session.thisUser.getEmpData()

                                and I could then use  #empData.name#,
#empData.dept#, etc.

2)      Have multiple methods, one for each item of data (there could be up
to a dozen items), and use:

                                #session.thisUser.getName()#,
#session.thisUser.getDept()#, etc.


3)      Or a variation on #1, where I pass in the requested variable, as in;

                                #session.thisUser.getEmpData(name)#,
#session.thisUser.getEmpData(dept)#

Is one approach 'better' or more correct from as deign perspective or does
it just depend on one's preferences and particulars of the application?


Walt

Walt Sparrow-Hood
Director, E-Commerce
GenTek, Inc.
V - 973-515-1835
M - 973-723-7910
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

Reply via email to