Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Properties

Property

Description

Decouple category

Front-end (4)

Complexity

Low

Related patterns/solutions

 

Table of Contents
maxLevel2

Summary

In dialogs many input validation rules different types of validations are used. Some (input) validations will be defined within the domain layer and used within dialogs (interface layer), others are only defined and used within dialogs (e.g. correct birthday, telephone numbers, etc.). Validation rules defined within the domain layer will cause coupling between dialogs and business rules which will leads to many undesirable effects.

Image Removed

Context

  • 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

declarative rules

 

 

  • Are the various choices compatible?
  • Is this application acceptable?
  • Calculation
  • Decision based on policy rule

 

 

 EigenschapOmschrijvingKennis ontsluitingImplicit vs explicit call Simple/Complex parameter Truth maintenance Implementatie kenmerkenTestableFront-end and business rules are independently testable. MaintainableBusiness 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.

 

Pim:

  • Validatieregels 

 

 PropertySupport attributesValidation service  KnowledgeImplicit vs explicit callimplicitexplicit  Simple/Complex parameter    Truth maintenance(green star)(red star)  Implementation
property
Testability(green star)(green star)*  Maintainability(star)/(red star)

(star)*

  Out of the box(green star)(red star)  

*Business rules implemented in code, not in Blueriq.

Support attributes

 

Validation service

 

Issues and considerations

 

Related patterns

 

There are validations which define when a value is valid at all, and there are validations which are rules defined by the business. For example an date of birth is only a valid date of birth if it is not in the future. The business however wants only to allow applicants of 18 years or older, so the date of birth should be 18 years or more in the past.

Speaking in terms of the clean architecture, the validation rules that indicate whether a value is valid at all are located in the interface layer. The validation rules which are determined by the business are part of the domain layer. This article discusses the second kind of validation, and how not to mix the interface layer with the domain layer.

Contents

Table of Contents
maxLevel2


Problem

Business rules and validations deserve special attention in Blueriq. Please see Business Rules and the Clean Architecture for more information.

In this small example, we discuss the case that the business imposes that an applicant should be 18 years of age. For this scenario it is important that the rule engine triggers automatically and no flow is needed and that Blueriq can provide support with features such as dependencies and the decision requirements graph.

Solutions

No decoupling

Module with Flow

Expand
titleExpand to see the Module with flow pattern characteristics

Include Page
Decoupling Pattern 1: Module with Flow Score [Internal]
Decoupling Pattern 1: Module with Flow Score [Internal]

Issues and considerations

We advise to use the Decoupling Pattern 1: Module with Flow for this example. It fullfils all requirements, and gives additional support in the form of unit tests in your model. There is also a neat separation of business validations and general validations. Applying no decoupling can still be a valid option if the overall application is small, but this choice should be revisited when the application grows.

Decouple category

Image Added

Properties

PropertyDescription
Decouple categoryCustomer Facing Applications (4)
ComplexityLow
Related patterns/solution