This is one of the choices for Assignment 2.
Goal: Design and implement a reflective architecture ("homemade" meta-layer)
For each type of product one must be able to define the relevant types of attributes and how the price of the produxt is computed as a function of their values.
The model must offer support to describe any types of products (cars, insurance policies, toys, etc). The types of products are not known in advance. Every product type can have different types of attributes.
For example, in the case of products of the type insurance policies, each kind of policy (home, life, accidents, travel, etc) has a different set of attributes. A home insurance has for example following attributes: initial value at building time, age, location. A car insurance has as relevant attributes the brand, the age and engine power.
For each product type (home insurance, life insurance, car insurance, etc) we can define business rules that describe their algorithm of price computation. For example, for a car insurance the price is computed according to the following rule: price=1000*coef_lookup(brand)-10*age+5*engine_power
Standard requirements: The standard requirements for this assignment variant already include 1 Bonus point.
Following features must be supported:
For the standard requirement, the program does not need to be interactive, just demonstrate the concepts and patterns. It can be something similar with code on Slide 38 of lecture dacss5-2023.ppt, but include also a demo for the creation of price business rules and their application.
Additional bonus points: a second award point for implementing the following extension according to the Adaptive Object Model pattern:
Example1: Creating and using bank account application
Example2: Creating and using shop inventory application