Gather and discuss proposals for V3 API changes

Issue #259 resolved
Maksim Volkau
repo owner created an issue

In order to have overview of planned V3 changes and their possible relation, I want to gather the proposals in one list.

The list below contains proposals and d&oes not gurantee their impl in v3:

implemented features are in v3 branch

DryIoc

  • [#254]: [Performance] Remove state parameter from FactoryDelegate - use FastExpressionCompiler with closure support
  • [#288]: Make Resolution scope a normal child scope under Current Scope instead of separate entity
  • [#270]: Diagnose Fallback / Facade Container problems and find better implementation
  • [#255]: Make GetCurrentScope available on IContainer via extension method
  • [#232]: Change RegisterInstance defaults to IfAlreadyRegistered.Replace and to Reuse.InCurrentScope
  • [done] Split ImTreeMap, Ref, ArrayTools used both by DI and DIZero into separate namespace (DryImTools) and file. Then share the file between DI and DIZero.
  • Improve Container.With... copy methods:
    • [done] Add ability to copy Singleton and Current Scope
    • [done] Move With/Without methods from IContainer interface to ContainerTools as extension methods. It will be possible with public Container constructor.
    • Make the With/Without method an extension for T where T : IContainer so that I can write var c = new Container(); c = c.WithBlah() without declaring c as IContainer.
  • [done] Introduce more simple / familiar name for current scope reuse, and for resolution scope reuse as they are unified now:

    • Reuse.Scoped
    • Reuse.ScopedTo(name)
    • Reuse.ScopedTo(serviceType, serviceKey) for resolution reuse
  • Add ScopeTo overloads to support multiple names, e.g. scoped to "X" and to "Y"

  • [done] Simplify IReuse, IScope, IScopeAccess API for easy extension and proper usage

    • [done] Simplify IReuse custom implementation, may be by introducing the abstract base class or/and minimizing the interface.
    • [#268] Inject interface with access to OpenScope and CurrentScope
  • [done] Rename ImTreeMap to ImHashTree, and ImTreeMapIntToObj to ImTree. Test ImTools separately with full coverage. Idea is to reuse the Tools independent from DryIoc.

  • [done] Improve PropertiesAndFields API:

    • [done] Simplify specifying IfUnresolved.Throw
    • [done] Simplify filtering out properties of base class
  • Decorators

    • Throw on using serviceKey with Decorator
    • Make Setup.DecoratorWith(useDecorateeReuse: true) the default.
  • Func simplification to get rid off Func parent check in request chain to identify lazy scenarios:

    • By default inject service asResolutionCall
    • To enable Func<args...> we need to add object[] args to Resolve call
  • [done] Cut method names in ReflectionTools for easy remembering.

  • Perf and memory

    • [done] Minimize Request parents traversal by memoizing the checked states in flags property in each request
    • [done] Add back the resolver context to Request to represent resolution common state.

DryIoc.MefAttributedModel

  • [#291] Improve MEF compatibility
  • [#195] Composable Metadata as a IDictionary of string - object
  • [#293] Integrate lazy part discovery into MefAttributedModel API
  • [done] Rename two WithMefAttributedModel methods to WithMefRules and WithMef respectively.
  • [done] Rename ImportWithKey to ImportEx
  • [#323] Support multiple WithMetadataAttribute(key, value)

Comments (43)

  1. Log in to comment