Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Builder design pattern

 
Ionut Puna
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am new to design patterns, but willing to learn. So I came here for an advice, as this would be my first attempt in implementing the builder pattern.
The project: Create a java application that will generate and send via email 6 exports (Excel files) of different types, having their data filled from a database. The names of the exports, as well as other filters, will be read from an XML file passed as an argument in the command line.
My solution was to use the builder pattern, as it follows:

Buider:


ConcreteBuilder:



Director:


Product:


Application:



Can someone please tell me if this design is well thought? I would appreciate any help you can give me.

An other question: Keeping in mind that the XML with the requested filters is received as a argument in the command line, how can I have access to the filters in the ConcreteBuilder classes? it is a good design to pass the ExportFilters object as an argument to the constructor, like
new BuilderExportImplementationA (ExportFilters fe)
Also, the methods saveExport(String path) and sendExport(..) to which class will they belong?

Thanks.

ps: Please excuse my grammar, as english is not my native language.
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Ionut.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic