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:

http://www.dofactory.com/net/strategy-design-pattern


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -