Menu
Why Hyperon

Business domain designer

The domain allows you to define types and create objects representing your business model. Each object can have a set of attributes, which take parameters, functions or literals as value.

The Domain achieves two main goals:

  • it allows you to organize your parameters and functions into business objects, creating an easy way to navigate your configuration;
  • it creates a transparent way of accessing those parameters and functions from your application (or within Hyperon functions) without tying it down to specific parameter/function names, allowing you to only hardcode behaviour that is common to all objects of a given type, while maintaining the freedom to implement specific behaviours of each object individually.

Parameters and functions answer the question of how you would like to parameterize. Context answers the question of what parametrization can depend on. And least but not last -- domain answers the question of what you would like to parameterize.

Indeed, domain model is what we want to be configurable:

  • using Menu-Model-Domain definition we can design domain types, their relationships and attributes;
  • using Menu-Model-Domain configuration we can create instances of domain types and configure their attributes with use of parameters or functions.

Imagine, we want to configure life insurance products:

  • each life insurance product consists of covers and funds;
  • each cover has different maximum insurance sum, availability, premium logic, etc;
  • each fund has different transfer fee, etc.

We can use Domain definition to define types for our domain, for instance:

type:
attributes:
elements:
   - covers:
   - funds:

type:
attributes:
   - max_insurance_sum
   - is_available
   - base_premium

type:
attributes:
   - transfer_fee
   - …
Product
none

Cover []
Fund []

Cover





Fund



// Product has collection of Cover elements
// Product has collection of Fund elements



// value we want to configure
// boolean
// decimal value

Next, we can use Domain configuration to configure domain elements and their attributes:

Product [code = PR1]
  covers
   * Cover [CA]
      - max_insurance_sum  
      - is_available        
      - base_premium        
   * Cover [CB]
      - max_insurance_sum  
      - is_available        
      - base_premium        
    ...

Product [code = PT3]
  covers
   * Cover [DB]
      - max_insurance_sum  
      - is_available        
      - base_premium        
    ...

and so on...



=  10000
=  yes
=  50.0

=  from parameter : 'pr1.covers.maxIS'
=  yes
=  from function  : 'pr1.premium.calc'





=  from function  : 'default.maxIS'
=  from parameter : 'pt3.cover.isAvail'
=  from parameter : 'pt3.tariff.basePr'

Now, application connected to Hyperon can use any defined logic solely through domain layer. These are sample scenarios:

  • getting all products from domain,
  • getting all covers from product "PT3",
  • getting all covers (from given product) with attribute is_available equal to true,
  • calculate premium for given cover - just by getting value from base_premium attribute.

Read more on Domain in our Tutorials: