Variations on concrete implementations of I_A and the constraints with computations they carry

Gallery
Tutorial
An overview of the basic pattern for varying the computation:
Click on the image to view it full size

This is quite a complex diagram at first glance, but it helps to see it all in one place. Let's break it down:

The block A1 is a concrete implementation of the contract I_A. It inherits also two value properties x and y from a block CommonA (we'll see later why it's done this way, but for now note that it separates the contract part from the implementation part in a clean way). It carries also a redefining constraint property c typed by a more specific ConstraintBlock CA1 with a specific constraint equation o=x+y.

The block A2 follows a similar pattern. However, it adds in an additional value property z, and its redefining constraint property c is typed by a specific ConstraintBlock CA2 with a constraint equation o=x+y+z.

So, if the system runs with an instance of A1 configured in the value property reference a of the Client, the equation o=x+y will be used, and if it runs with an instance of A2 on reference a the equation o=x+y+z will be used. This is the sense in which the examples describes Dependency Injection!

Up next
Notes
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)