I tried using an adapter template. The main objects lie in the logical layer and are wrapped using composite objects so that presentation and data access layers can work. Most classes of presentation and data access classes use interfaces. Wrapping (compound) objects lie in the layers of presentation and access to data and implement the interfaces of these layers.
In addition to composite objects, there are controller objects that can extract data from logical objects and create new objects (i.e. a list of rows).
source share