Export to GitHub

dataobjectsdotnet - issue #557

Refactor DomainConfiguration.Types usage: it must properly support IModules, compiler containers, etc.


Posted on Dec 23, 2009 by Helpful Panda

I'd like to have a single point for configuring: - Available persistent types - IModules // currently they're detected by completely different way - Compiler containers - Session & Domain-level services (e.g. new IQueryPreprocessor is Domain- level service): in fact, we must add them to default IoC resolvers. - Possibly, even IoC default resolvers. Custom IoC resolvers must work - nearly as it happens now.

DomainConfiguration.Types is actually a good candidate to be this point: if you register a whole assembly or namespace, it must expose all these types available in it. To implement this refactoring, we must: - Add exclusion mechanism there. It must be useful. I.e. TypeRegistry.Skip(...) - Fix current filtering condition there to appropriate (more types must "pass" it) - Filter its result, when it's used - Replace IModule search code to the appropriate one - etc.

The idea is to provide a convention over configuration pattern for all this stuff like we did with persistent types.

Comment #1

Posted on Jan 12, 2010 by Helpful Panda

FilteredTypeRegistry must be added as well; TypeRegistry must be extended to support it.

FilteredTypeRegistry usage is optional: - config.Types.Register(myAssembly) - register all types from myAssembly - config.Types.PerisistentTypes.Register(myAssembly) - register just persistent types

This will: - Allow developers that prefer more readable declarations to use them - Allow us to enumerate e.g. all SessionBound objects easier.

Comment #2

Posted on Jan 12, 2010 by Helpful Panda

Forgot to write that config.Types.PerisistentTypes is FilteredTypeRegistry.

Comment #3

Posted on Feb 7, 2010 by Helpful Panda

Done.

Instead of adding FilteredTypeRegistry I finally decided to provide just a set of IEnumerable, see http://goo.gl/rgzc

Comment #4

Posted on Feb 7, 2010 by Helpful Panda

(No comment was entered for this change.)

Status: Done

Labels:
Type-Refactoring Priority-Critical Milestone-Release4.1.1 Component-Storage