Re: Storing condition in bitfield?




"R. Rajesh Jeba Anbiah" <ng4rrjanbiah@xxxxxxxxxxxxxx> wrote in message news:1139997976.832280.242840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I don't think, it's the right way to map the form fields and their
constraints with XML or string. IMHO, it's better to store the state
and validation function to a small integer or so.

Yes, it'd be best if we could store full length high-definition 2 hour movies into a single bit... but we can't!

At best, we could store the function in a medium-to-large integer (e.g. the number of the Turing Machine which performs the task desired), but then you've got the performance overhead of decrypting the integer into runnable PHP code, or of directly interpreting the integer somehow.


As I mentioned earlier, I'm interested in building a generic
framework for handling form inputs.

I wanted to replace the current way of validating form inputs like:

if (isNotEmail($form->field('email'))
throw error
if (isNotEmpty($form->field('url') and
isNotEmpty($form->field('url'))
throw error

I instead wanted to save/associate the state or functions with the
form fileds. Putting strings and XML will be of overhead, I think.

You might be optimizing prematurely. Are you sure that RAM or memory is more valuable than developer time?

- Oliver

.



Relevant Pages

  • RE: Embedd XML within XML - Possible ??
    ... it is not quite recommended that we store such ... If you do want to store complex XML data into the attribute field. ... Microsoft MSDN Online Support Lead ... ID Field and String Field ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Datatable Row Number
    ... I am using a datatable to store some data from the xml. ... I need the row number where a particular string exists ... FUnky ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: http parameter casting
    ... > from the request validating etc. ... > comes through the request as a String but should be stored as an int). ... That is unless I store all of the user's original ... Generate HTML output from XML using XSLT. ...
    (comp.lang.java.programmer)
  • Embedd XML within XML - Possible ??
    ... ID Field and String Field ... The ID Field is a unique key and the string holds a xml string that store my ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SP1 Problem SOAPException doesnt return quote and Umlaute correcty
    ... Our app returns XML in the fault string. ... returned in the fault string of a soap exception. ...
    (microsoft.public.dotnet.framework.webservices)