April 2019
Intermediate to advanced
360 pages
9h 17m
English
We will use a real estate land area calculation program to demonstrate how to implement the adapter design pattern. We will have two similar classes that do not inherit from the same class and cannot communicate directly with each other without an adapter. The Lot class will simply contain a length and width so acreage can be computed as square feet. This assumes small lot sizes. The Estate class acreage will be computed as acreage as those lots sizes are much larger.
Read now
Unlock full access