oop - Design pattern for generating multiple documents based on data sources -
i'm doing software can generate multiple types of documents.
let's can generate shipment documents containing following attributes on xml:
- recipient full name (provided customerservice)
- recipient address (provided addressservice)
- product (provided productservice)
if product type producttype.car, document should have car model (provided carservice given product id fetched productservice).
i want able generate document uses same services, present information on different ways (for instance, last name instead of full name).
my goal fetch these information lazy possible (ie, don't want begin generating document calling possible sources of information of document - because require me set hierarchy calls since 1 information may depend on - in example above, need provide product id fetched productservice carservice if product happens car).
does looks design pattern?
i'm in doubt between bridge , builder... couldn't make work of them far. end business logic inside documentwriter; or calls noop.
i solve strategy. each type of document 1 implementation:
Comments
Post a Comment