Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Summary
Value lists are filled from master data. These value lists contains all possible values within a domain. This domain can easily read from a source and apply within the domain layer. The list is managed and determined outside of the application. For example, country lists, occupation codes, municipalities, etcIt 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
Table of Contents | ||
---|---|---|
|
Context
Within applications, lists in the form of a value list are used regularly. 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.
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
The solution takes into account the features that are named in the table in paragraph "Context".
There are several solutions that can be realized to a greater or lesser degree by the above characteristics. In each case, the best solution should be chosen. The table below shows the most important features and how each solution scores.
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.
Webservice
When there is a web service available which returns all municipalities as instances, then the AQ_InstanceLinker can simulate a value list. This pattern fullfills 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 | ||||||
---|---|---|---|---|---|---|
| ||||||
|
External Value List
AQ_CscConnectivityService
The AQ_CsvConnectivityService can be used to load a CSV file into the profile. It is shown as value list with the 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 advtantage 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 AQ_InstanceLinker.
For a larger discussion on Master data, see How to handle Master Data.
Decouple category
Image Added
(dynamic)
(static)
(dynamic)
1External source check mark property of Value List and configuration. Work for Business Engineer.
2Custom code for reading data from source and the creation of instances. Work for Technical engineer.
3Depends on number of values/instances in the list.
Below differeent solutions will be described. For the realization of a specific solution, a reference is made to the relevant pattern and a concrete example is described.
Value list static
Value list defined within Blueriq Studio once. This value does not change run-time anymore.
Changing the value list requires a model customization and deployment.
With small value lists (<10 values), maintenance is easy. With a large value list (100+ values) maintence is very cumbersome.
Example
Adding values to a value list is descrbied in MyBlueriq.
Value list dynamic
An external rule also allows business rules to be implemented and unlocked. Compared to the Function, an external rule is not possible to ensure autonomy. An external rule uses attributes within the same domain as the application so that unwanted mixing is possible. In addition, the maintenance is low because an external rule is a rule that is implemented in code. Business rules do not want to be implemented in code but in Blueriq because of its maintainability.
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
Adding values to a value list is described 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 that change regularly should be implemented by an external value list. The initial work is way more compared with a static value list, but the maintenance is way less. With an external value list you do not have the option to apply design-time model validation. In an expression, a value can be used which does not exist. This is only observed run-time.
Value lists that are constant (e.g. gender, yes / no / unknown) should be realized by a (static) value list.The values are defined design-time.
Decouple category
Image Removed
Properties
Property | Description |
---|---|
Decouple category | Database decoupling (2) |
Complexity | Medium |
Related patterns/solutions |
|