Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Data validation dialect

From: gerardcote:gm:ail at: 23-Dec-2009 22:14

Hi Graham, This is what I will begin with but my true goal is to have both an implementation and a dialect for describing what the data validation rules specs are, be it localized in the app itself or in an external shared data object or centralized dictionary. Kind of minimalist general business rule encoding - like is done by databases systems and centralized data-centric objects in a true multi-tier app - eventually I'd like to have such a system running ... since I gradually want to move the business rules from the presentation layer (GUI) to a common data layer, which is somewaht easier to share across a distributed app, via services, for example. For the moment, I'm trying to figure out most of the common ways in use that describe form (and field) data specs and validation rules and what is better done at the UI level. Sometimes but not always, this kind of validation is driven by the data type and the domain of values each type permits. So I want to collect some of those ways that are in actual use, just to see if there is some general logic that can be applied through my own "data validation definition dialect" design. Here is my first summary : (sure there are others and would be glad it anoybody would enrich/correct this first draft) (My only past experience in this domain comes from the design of VB input forms, thus validating at the field and at the form levels. Everything else comes from recent readings. So many misconceptions/missing info are more than probable). At the field level we generally find those relevant attributes, independently of the GUI system, I think : ---------------------------------------------------------------------------------------------------------------------------------------------------------- - Mandatory/optional - Protected/writable - Visible/hidden - Size, position, color, etc... - Behavior (local event management and simple validation rules - most related to datatype, i.e. Numeric! - discrete or continuous : min. max, interval(s), inclusion or exclusion related boundary conditions expressed by means of functions, etc...; String! : pattern recognition, uppercase, phone number, valid date, ...) At the form level we have to take into account for : ------------------------------------------------------------------------ - Behavior (Global event management and dependencies between some or all of the fields - expressed by more elaborate validation/derivation rules) Then there are also what are called the other more general business rules - generally taken into acount at the object/database level -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Behavior/dependencies related to the business way of doing things (policies) Just asked myself about what "formal or natural - dialect" language could be used for defining the specs of these validation/business rules AND WHERE TO PUT /when to use THEM ? ==================================================================================================================================== Began some research and found many alternatives already in use : 1- saw an article about the OCL part of UML that is used playing this role for objects classes constraints (wikipedia) 2- saw in one of my old books a reference to BNF stating that by 1984 it was the formal tool to be used for string pattern recognition (Here we have parse coupled with PEGs) 3- OASIS ia another formal description language used as the basis for the OlivaNova OO-Method and the Just-UI (See URLs : www.care-t.com/index.asp www.ercim.org/publication/Ercim_News/enw57/pastor.html www.dsic.upv.es/~einsfran/papers/06-CAISE97.PDF portal.acm.org/citation.cfm?id=964442.964522 www.dsic.upv.es/grupos/oom/oasis.html - this last one the OSAIS 3.0 spec is available in Spanish only) 4- Finally in the prolific Java/Ruby World there are descriptive testing tools (Fit, JBehave and RSpec) that are more of the By example kind - They describe the same thing the xUnit family members are able to test but using a behavior related vocabulary The refs about the tools related to BDD from Dan North and David Chelimsky - (URL dannorth.net/introducing-bdd) See also Agiledox/TestDox tools (URL agiledox.sourceforge.net/) 5- Then another view desserves a good mention about describing and implementing business rules in REBOL itself - (URL: computer-programming-languages.suite101.com/article.cfm/how_to_createa_rebol_dialect#ixzz0KnhL2yyi&C) Why didn't I think about it before ? probably because I want to get a descriptive approach and I wil have to create some dialect to do so. 6 Also found this about the new VB 9.0 Query mode - Will try to get my hands for creating a similar one for REBOL when ready to do so (URL : tinyurl.com/z8z82)