Results 1 to 3 of 3

Thread: Runtime class mapping - at startup or on demand?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Runtime class mapping - at startup or on demand?

    I have the need to map a number of different classes in my application to specific instances of a class that is in charge of persisting them to/from the back end.

    This is conceptually similar to the way Entity Framework creates it's mappings with the DbModelBuilder class.

    Should I map all the classes at application startup? (They are identifiable by an interface and an attribute tag) or should the mapping occur when a particular class is first used?

    (or both, configurable?)

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,881

    Re: Runtime class mapping - at startup or on demand?

    I'm not quite sure what you mean by "map" in this instance.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Runtime class mapping - at startup or on demand?

    Given a configuration file like this:-

    Code:
        <ImplementationMaps>
          <Map AggregateDomainQualifiedName="HospitalWard.Nurse" ImplementationName="InMemoryImplementationExample" SnapshotSettingsName="InMemorySnapshotExample" />
        </ImplementationMaps>

    I want to map the class "HospitalWard.Nurse" to be stored in an In-memory data storage called "InMemoryImplementationExample".

    The idea is that I can change the mapping between different storage technologies (file, database, memory) without recompiling my application.
    (It's a bit like routing is configurable in a web app)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width