This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Builder design pattern  RSS feed

 
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: 2632
17
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Ionut.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!