aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Builder design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Builder design pattern" Watch "Builder design pattern" New topic
Author

Builder design pattern

Ionut Puna
Greenhorn

Joined: Jan 11, 2010
Posts: 1
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

Joined: Dec 20, 2006
Posts: 2503
    
    8

Welcome to the Ranch, Ionut.


OCUP UML fundamental and ITIL foundation
youtube channel
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Builder design pattern