It would depend on what you are doing. If there is some obvious, known difference between the addresses (work, home, whatever) then you might have different methods (getWorkAddress() or getHomeAddress()) that return individual Address instances. If they have an arbitrary number of houses that are not differentiated, you could return an array of Address objects. Or you could return a query of addresses (possibly using an AddressGateway). It all depends on the context of what you're actually trying to do and what makes the most sense.
On 6/1/05, Johnny Le <[EMAIL PROTECTED]> wrote: > > Hi Brian, > > How would you handle if the user has 3 or 5 houses? They are just houses, > no distinction whether they are beach houses or city houses. So the user has > 3 or 5 addresses. Will you pass an array of addresses into the user's init > method? or will you do user.getAddresses() and return a query of > addresses? > > Johnny > > >That is correct, assuming that you are dealing with one User object that > is > >compositing an Address object. Sean already explained using a gateway to > >bring back multiple of users and their addresses together. > > > >Assumign one User object, you could run one query to get the address for > the > >single User, populate the Address object with that data, and then all of > >your method calls would just be reading the instance data from the > Address > >object. There shouldn't need to be any additional queries for address > >information. > > > >On 6/1/05, Johnny Le <[EMAIL PROTECTED]> wrote: > >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:208307 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

