user defined function outside of compiled code

Results 1 to 2 of 2

Thread: user defined function outside of compiled code

  1. #1
    Join Date
    Dec 1969

    Default user defined function outside of compiled code

    Can someone lead me in the right direction for this?<BR><BR>I&#039;m writing as ASP.NET web app that reads some data from an Excel file. It validates that data based on an XML configuration file that I&#039;ve designed. <BR><BR>In my XML file, I have an attribute called "validationRule" which is a user-defined Regular Expression that validates a certain piece of code.<BR><BR>Now suppose I have some data that requires more complex validation than just a Regular Expression. Suppose I want to write my own custom function.<BR><BR>Is there a way that I can add another attribute to my XML file, say "customValidation" and set it equal to the name of a user defined function in some external file?<BR><BR>Something like this for example:<BR><BR>&#060;MyXMLConfig customFunctions = "customFunctions.cs"&#062;<BR>...<BR> &#060;SomeField customValidation = "myValidationFunction"/&#062;<BR>...<BR>&#060;/MyXMLConfig&#062;<BR><BR>When my web app loads, it would read the XML Configuration file. When it got to the &#060;SomeField&#062; tag, it would know to call the function named "myValidationFunction()" (when it was time for validation) that was located in the file "customFunctions.cs"<BR><BR>Anyone know how difficult something like this is to produce?<BR><BR>Thanks<BR>-Steve

  2. #2

    Default RE: user defined function outside of compiled code

    It is bound to involve some Reflection.<BR>A provider or config based factory can probably solve it.<BR><BR>How will users add new validations? Will it be arbitrary people adding new validations?<BR>

Posting Permissions

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