May 2017
Intermediate to advanced
442 pages
11h 55m
English
This pattern achieves a safe method to allow a functional consultant (or end user) to choose the business logic based on data. This is very powerful, and allows other parties to add their own plugins, which are to be used instead of those supplied.
To understand what is going on, the first thing to know is that we can write the following code:
ConWHSVehicleColorable colorable; colorable = new ConWHSVehicleGroupColorRed(); Color myColor = colorable.Color();
We can't instantiate an interface, but we can assign an instance of a class to a variable declared to be an interface, as long as the class implements the interface. Any errors will be handled by the compiler. We will consider the interface to be a code contract, and the ...
Read now
Unlock full access