/src/Otis/IMappingDescriptionProvider.cs

http://otis-lib.googlecode.com/ · C# · 38 lines · 11 code · 1 blank · 26 comment · 0 complexity · e59a9d1f4055e9eddb17bbbda83b6072 MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Otis.Providers;
  5. namespace Otis
  6. {
  7. /// <summary>
  8. /// This interface is used to provide <see cref="Configuration"/> object with mapping information
  9. /// </summary>
  10. /// <remarks>
  11. /// Configuration class can be configured from various sources: XML data, directly from the assembly which
  12. /// contains mapped types, etc. Internally, <c>Configuration</c> class accesses this information through
  13. /// instances of <see cref="IMappingDescriptorProvider"/> interface. For every supported source type,
  14. /// there is an implementation of <c>IMappingDescriptorProvider</c>. E.g. XML data is processed using
  15. /// <see cref="XmlMappingDescriptionProvider"/> class, while assembly metadata is processed using
  16. /// <see cref="AssemblyResourceMappingDescriptorProvider"/>. To provide support for custom mapping info
  17. /// sources, client applications need to provide an implementation of <c>IMappingDescriptorProvider</c>
  18. /// and call <see cref="Configuration.AddProvider"/>.
  19. /// <example>
  20. /// Example:
  21. /// <code>
  22. /// Configuration cfg = new Configuration();
  23. /// // CustomMappingProvider is an imaginary class which reads mapping info from web service
  24. /// IMappingDescriptorProvider provider = new CustomMappingProvider("http://server/get_mappings.asmx");
  25. /// cfg.AddProvider(provider);
  26. /// </code>
  27. /// </example>
  28. /// </remarks>
  29. public interface IMappingDescriptorProvider
  30. {
  31. /// <summary>
  32. /// Returns a list of mapping descriptors. For each tranformation type, there is an
  33. /// <see cref="ClassMappingDescriptor"/> instance in the list
  34. /// </summary>
  35. IList<ClassMappingDescriptor> ClassDescriptors { get; }
  36. }
  37. }