How Facade Flow Works

DTO (Data transfer object) :- It is a object that used to encapsulate data, and transfer the data between classes and modules of your application. Data Transfer Objects (DTOs) are objects created to only contain values and have no business logic except for getter and setter methods.

Converter :- It creates new instances of Data objects and call Populators to populate data. It contains list of populators and uses populators to convert data from source to target.

Populator :- It fills the data object by getting the data from the model.

How flow works?

  • Data is fetch from DB and pass model to service layer.
  • Service layer called by facade layer and pass Model object to facade.
  • Converters and populators are used in facade layer to convert the model to DTO.
  • Populators used for get value from source model and set value in target and we call to converter method and Converter internally calls the list of populators.
  • This should not be done in out of the box, so above you can see we extends (CustomerPopulator) by (FallbackCustomerPopulator).

Leave a comment