Hey guys.
Sorry for the long reply. I've thought about everything that was
mentioned here but just didn't articulate a response.
I had an moment of clarity today, and I think that lazy loading is the
way to go. I was really wanting to keep my beans "pure" and not
contain any references to my DAOs, but I think the tiny bit of logic
required to pull "child" objects into the bean when required (lazy
load) is insignificant next to the advantages of doing so.
As for arrays of beans, and I agree that the solution should match the
situation. If you are writing a performance sensitive app under heavy
load, then I might avoid arrays of beans unless they would be very
small arrays. For many other sites, I think that it is justifiable,
especially with the performance gains in CF9 with respect to object
instantiation (See here for a great writeup:
http://jamiekrug.com/blog/index.cfm/2009/7/21/cfc-creation-time-in-coldfusion-8-9-open-bluedragon-11-and-railo-31
)
Thanks for the responses guys.
-Brian
On Sep 2, 5:10 pm, Guilherme Pinto <
gpi...@fotogram.com> wrote:
> I'm no design expert, but sounds like your relationships should be
> kept in the database and not as nested properties in your beans.
>
> In your project bean your getStaff method would fetch the data from
> the database using the project OID as the lookup key.
>
> Same idea for the other beans.
>
> Hope that helps.
>
> Guilherme
>
> Sent from my iPhone
>