Menu

Objects with an Arguments in Constructor

2005-04-01
2013-03-07
  • Nobody/Anonymous

    Hi,

    I want to make obejcts persistable which have arguments in their constructor. The System.Activator.CreateInstance(t) method called in CClassMap of course fails to do so...

    Is there a way to pass a factroy method to the AToMSFramework? Or is there another workaournd?

    Thank you very much,
    Felix

     
    • Richard Banks

      Richard Banks - 2005-04-03

      Hi Felix,

      Good question.

      If you create a factory that implements AtomsFramework.IClassFactory you can control the creation of objects (this is required for persisting interfaces for example).   All you need to do in the class mapping in the XML file is include an XML attribute like factory="myClassFactory".

      The problem you will have is that there are no parameters passed to the CreateObject method of the IClassFactory interface, which also means there will be no context provided for your factory.

      - Richard.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.