Proposed Changes

0 views
Skip to first unread message

David Laribee

unread,
May 8, 2008, 8:21:19 AM5/8/08
to xe...@googlegroups.com
Couple of changes I'd like to make:

IoC -> Locator, I believe this better reflects the intent of this gateway to IoC container; it is a service locator.

Repository.FindByID -> Repository.FindBy(Guid ID);

Repository.FindByQuery -> Repository.FindBy(INamedQuery query)

Thoughts?



--


/ Dave

http://thebeelog.com

Bil Simser

unread,
May 8, 2008, 9:01:00 AM5/8/08
to xeva
IoC is a techie term so Locator might make more sense. I guess
everyone is used to see an IoC class (I don't know how many I have in
my projects) because that's what it is technically. Locator is more
domain like sounding. If it's really just a service locator then why
not ServiceLocator? Locator might indicate to me a way of finding
something (not necessarily a service) or locating something on say a
screen layout (e.g. Screen.Locate(myControl) which would return a
Point object)

I waffle between the FindBy(criteria) and FindByCriteria() syntax.

FindByID(Guid ID) almost sounds redundant but if you only look at
FindByID() vs FindBy() you need to know what parameter you're passing
in the second method. From an intention revealing interface, FindBy()
requires the parameter type to know how you're trying to find
something.

In my repositories I try to keep the number of FindByxxx methods to a
minimum so if I see:

FindById
FindByGuid
FindByLastName
FindByFirstName
etc.

I'll look at collapsing some of the finders to:

FindBy(IIdentity id)
FindBy(ISpecification spec)

Bil Simser

unread,
May 8, 2008, 7:58:05 PM5/8/08
to xeva
Just wondering about "Locator" vs something like DependencyResolver. I
know Locator is more businessy sounding, but it doesn't clarify what
it's locating does it? Is it a web service, an implemenation of an
object, or what? If you renamed IoC to DependencyResolver and change
the Resolve<T> methods to Get<T> it would line up with the AMC which
might be good? (I know, you've already renamed IoC to Locator but hey,
that's what refactoring is all about right? ;)

On May 8, 6:21 am, "David Laribee" <da...@laribee.com> wrote:
Reply all
Reply to author
Forward
0 new messages