In dialogs different types of validation rules are used. This article only focus on input validation (e.g. valid birthday, telephone numer, etc.) which is only defined within the dialog. This kind of validation rules won't create coupling with the domain layer. Different solutions are possible which are discussed. Depending on the context a Blueriq validation rule or a support attribute should be used.
Context
Different kind of rules are used within an application. Business rules do have a special
Input validations and suport attributes.
op een plek definieren zodat onderhoud eenvoudig is. Weinig werkt.
Validatie service
Different rules exists in every layer within the clean architecture.
Interface layer
(front-end)
Application layer
Domain layer
Input validation
Format validation (e.g. correct phone number, IBAN, postcode)
Type validation (e.g. only string is allowed)
Input required
Value validation (e.g. age > 18)
Can we process this value?
Authorization/authenticatie rules
Can this user (role) see/modify this?
Can they overrule these warnings?
Process rules
What is the next step?
Which activity is not allowed?
Deducation/integrity/calculation rules
e.g. Product/underwring/policy/law rules
Are the various choices compatible?
Is this application acceptable?
Calculation
Decision based on policy rule
Eigenschap
Omschrijving
Knowledge
Implicit vs explicit call
Simple/Complex parameter
Truth maintenance
Implementation properties
Testability
Front-end and business rules are independently testable.
Maintainability
Business rules are easy to maintain. Front-end and domain logic are not intertwined.
Out of the box
Problem
Content of a value list changes more often compared to the application which uses the value list. Seperating application behaviour from maintenance of value list content which could be depend on external resources.
Solutions
Voor de oplossing wordt rekening gehouden met de kenmerken die benoemd zijn in de tabel onder "Context".
Er zijn verschillende oplossingen mogelijk waarbij de bovenstaande kenmerken in meer- of mindere mate gerealiseerd kunnen worden. Per geval dient de best passende oplossing te worden gekozen. In de tabel hieronder worden de belangrijkste eigenschappen getoond en hoe elke oplossing daarop scoort.
Property
Support attributes
Validation rule
Knowledge
Implicite vs explicite call
implicite
explicite
Simple/Complex parameter
Truth maintenance
Implementation
property
Testability
*
Maintainability
/
*
Out of the box
*Business rules implemented in code, not in Blueriq.