CSLA 4 ebooks: child object creator

CSLA 4 ebooks: child object creator

Old forum URL: forums.lhotka.net/forums/t/10236.aspx

tgddev posted on Tuesday, April 05, 2011

When explaining the use of a separate "child object creator":

- Objects ebook, rev 0.4, page 28/29: gets the creator calling DataPortal (Fetch/BeginFetch) <Creator>

- DataAccess ebook, rev 0.5, page 115: gets the creator calling the creator factory method (Creator.GetCreator(), sync/async versions)

The second way looks more "standard", doesn´t it?

For those of us who are learning, having more than way of doing the same is always (at least until we get the whole view) a bit confusing :)

Thank you.

RockfordLhotka replied on Tuesday, April 05, 2011

Consistency is good, yes :)

I'll forward this to errata@lhotka.net so it gets logged.

You are right, the more consistent approach is to have the child creator implement static factory methods.

tgddev replied on Wednesday, April 06, 2011

After all, the way shown on page 59 Objects,  Creator.CreateChild and Creator.FetchChild, seems to bring the benefits of both approaches: compact and clean. 


Copyright (c) Marimer LLC