[Gambas-user] Weird, yet again. Two way access to a collection. (not really a gambas issue)

Steve stevjensen at aol.com
Wed Nov 21 19:04:49 CET 2018


On 11/21/2018 6:17 AM, Bruce wrote:
>
> A real, real example is this. We have an application that lets horse 
> trainers submit a horse for an auction.  There are about 20 gazillion 
> rules and regulations about the animal concerned, which we need to 
> check in that application and several others before the horse is 
> acceptable as as lot in that auction.  So we have a component that 
> does all the necessary checking with the relevant authorities. If 
> everything goes OK then the component can send back a result code of 
> 400 ("Probity checks satisfied, proceed with submission"). Otherwise, 
> it may send back a code of, say 463 ("This horse is registered with &1 
> as being deceased! Best of luck with trying to sell it") where &1 is 
> replaced with the relevant authority name. The mnemonic in that case 
> :-) might be "REG_HORSE_DEAD". Which is is hell of a lot easier to 
> remember than 462, oops I meant 463, when maintaining the component 
> code. If you get my drift.
>
>
> And yes, the "products" change all the time. In this case they are the 
> regulations that apply to validating an auctionable lot.  And yes, the 
> *(%%&(^( authorities always pick the busiest time of the year to 
> implement the rule changes! @#^%*#^*# !!!!
>
>
If I understand this correctly I might investigate doing this as a 
database application.
Don't know the gambas database application capabilities or for that 
matter how flexible it is with runtime screen object creation
but...

An approximation of a  possible database (not even remotely meant to be 
a final solution) might look like
Parent = Agency* (name, contact info, remote submission info)
         dependent child agency rule = (rule#, rule_text, 
entry_datatype, entry_allowable_values*, remote submission format 
string, edit status*, eff_date, exp_date))
         dependent child rule>allowable_values (drop down box, range test)
         dependent child rule>edit_status (error#, error_text)

You could, at runtime, build an input form (either for all agencies or 
individual) with appropriate entry fields
Do local edits. (Horse age < 0.  Sale of potential horse not allowed).
Submit to remote agency/s and display responses

Essentially all your logic ends up in the database and none in your 
program code.
Not a simple implementation by any means but once done only the database 
needs to be updated as agencies send new regulations.
Your pgm would only need to be updated for new edit types.
Yes, this would be a major departure from what you appear to be doing now.
Its also possible to do mix and match pgm and db logic, say just the 
error codes.

Enjoy.





More information about the User mailing list