Versions Compared

Key

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

Summary

It is a common feature to supply a list of available countries to the end user so that he or she chooses one. This list rarely changes, but it sometimes does, which is not in control of the company. One can regard this metadata as information retrieved from the interface layer, and it should not be part of the domain layer.

Contents

Properties

Property

Description

Decouple category

Database decoupling (2)

Complexity

Medium

Related patterns/solutions 

Table of Contents
maxLevel2

Summary

Lijsten worden gevuld vanuit stamdata. Deze lijst definieer alle mogelijke waarden binnen een domein. Dit domein eenvoudig kunnen uitlezen van een bron en toepassen binnen de domein laag. De lijst wordt beheerd en bepaald buiten de applicatie. Bijvoorbeeld landenlijsten, beroepencodes, gemeentes, etc.

Image Removed

Context

Binnen applicaties wordt er regelmatig gebruikt van lijsten in de vorm van een value of instance list. The content of a value list could be defined design-time or run-time. In this document solution will be shown to fill a value or instance list. Every solution has it's own pros and cons.

The table below mentions the most critical considerations regarding the implementation of instance or value lists within Blueriq.

 

 PropertyDescriptionKnowledgeDesign-time validatie Run-time validatie Version management list content? Implementation propertyRead from external source Refresh value list Deployment needed/no design-time changes needed Maintainability 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.

Solution

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.

 

 PropertyValue list (static)Value list
(dynamic)Instance list
(static)Instance list
(dynamic)KnowledgeDesign-time validation(green star)(red star)(green star)(red star)Run-time validation(green star)(green star)(green star)(green star)Version management list content?(red star)(red star)(red star)(red star)Implementation propertiesRead from external source(red star)(green star)(red star)(green star)Refresh value listdesign timestart applicatiedesign timesession timeDeployment needed/no design-time changes needed(red star)(green star)(red star)(green star)Maintainability(green star)/(red star)3(star)(star)/(red star)3(star)Out of the box(green star)(star)1(green star)(red star)2


Problem

The problem which is addressed in this example is that the rate of change of the content of the value list is different than the lifecycle of the application itself. If these are coupled, then a new version of the application has to be created when the master data changes. When the master data changes is outside the span of control of the project. For a larger discussion on Master Data in different forms, see How to handle Master Data.

In our example of the municipalities, these change almost every year in the Netherlands. In 2005 467 municipalities existed and there were 458 municipalities in 2006. The general trend is there are less and less municipalities, and 2017 counted 388 municipalities.

An important aspect of this is that we want to maintain this list outside Blueriq, as it does not affect the behavior of the application (generally) and the data does not belong to the business for which we create the model. When the data changes, no new Blueriq application should have to traverse the DTAP street.

Solutions

Webservice

When there is a web service available which returns all municipalities as instances, then the Container type: AQ_InstanceLinker can simulate a value list. This pattern fulfills the requirement that the list is always up-to-date and that the model does not need changing when the list changes. This pattern is suitable for this amount of instances, but would not be if there would be much more municipalities, as otherwise too many instances would be present in the profile, reducing performance.

Expand
titleExpand to see the Webservice call pattern characteristics

Include Page
Decoupling Pattern 2: Webservices call Score [Internal]
Decoupling Pattern 2: Webservices call Score [Internal]


External Value List

The external Value lists can be used to load the data, and is a pattern specifically aimed at large or quickly changing value lists. The data is not part of the profile and is updated when the server is restarted. Another advantage is that the model stays clean. Custom code is required to determine the possible values.

AQ_CsvConnectivityService

The Service call type: AQ_CsvConnectivityService can be used to load a CSV file into the profile. It is shown as value list with the Container type: AQ_InstanceLinker, similar as above. The main difference is that the CSV file is maintained by the project, and not by an external party. This can be both an advantage as well as a disadvantage.

Issues and considerations

For the municipality case, we advice to use the external Value list. Although the implementation effort may be somewhat larger because of the custom coding, it awoids a large number of instances in the profile. It also keeps the model clean, as no additional relations or containers are needed as are with solutions which use the Container type: AQ_InstanceLinker.

For a larger discussion on Master data, see How to handle Master Data.


Decouple category

Image Added

Properties

1External source check mark property of Value List and configuration. BE werk.

2Maatwerk for inlezen bron en creeren van instanties. TE werk.

3Depends on number of values/instances in the list.

Hieronder worden per oplossing in het kort de verschillen in de implementatie beschreven. Voor de realisatie van de daadwerkelijke oplossing wordt verwezen naar het desbetreffende patroon en wordt een concreet voorbeeld beschreven.

 

Solutions:

  • Value list static
  • Value list dynamic
  • Instance list static
  • Instance list dynamic

Value list static

Eenmalig in Studio de value list definiëren. Deze waarde veranderd run-time niet meer.

Wijizigen van de value list vereist een model aanpassing en deployment.

Bij value list met < 10 is onderhoudbaarheid goed, bij 100+ is deze slecht.

Example

Het vullen van een value list binnen Blueriq wordt beschreven in MyBlueriq.

 

Value list dynamic

Met een external rule kunnen ook bedrijfsregels worden geïmplementeerd en worden ontsloten. In vergelijking met de Functie is het met een external rule niet mogelijk om autonomie te waarborgen. Een external rule maakt gebruikt van attributen binnen hetzelfde domein als de applicatie zodat ongewenste vermenging mogelijk is. Daarnaast is de onderhoudbaar laag doordat een external rule een regel is die in code wordt geïmplementeerd. Bedrijfsregels wil je niet in code implementeren maar in Blueriq vanwege de onderhoudbaarheid.

Example

Het vullen van een value list binnen Blueriq wordt beschreven in MyBlueriq.

Instance list static

Instances should be created design-time and show instances by using an instance linker. Define a relation attribute to catch the instances.

Example

The implementation of an static instance list will be described in MyBlueriq.

Instance list dynamic

Some custom code is needed to implement dynamic instance list. An external resource must provide the values for the instance list and instances should be created run-time.

Example

No example available. Too bad joh.

Issues and considerations

Value lists die regelmatig wijzigen via een external value list. Value lists die constant zijn, bijvoorbeeld geslacht, ja/nee/onbekend, die realiseren d.m.v. een value list design time. Bij een external value list heb je niet de mogelijkheid om design-time model validatie toe te passen. In een expressie kan een value gebruikt worden die run-time niet mogelijk blijkt te zijn. Dit wordt run-time pas geconstateerd.

Related patterns and articles

 

Property

Description

Decouple category

Database decoupling (2)

Complexity

Medium

Related patterns/solutions