jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Trails
  • TRAILS-174

Contribute builders to BuilderDirector

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2.0, 1.2.1
  • Fix Version/s: 1.2.2, 2.0.0
  • Component/s: None
  • Labels:
    None

Description

Add a way to add builders to the BuilderDirector so that users can make their own builders.
From the users list:

It's the GOF's Builder pattern http://en.wikipedia.org/wiki/Builder_pattern
First you need to implement this interface: org.trails.builder.Builder
It should as simple as:

public class InvoiceBuilder implements Builder<Invoice>
{

public Invoice build()

{ Invoice invoice = new Invoice(); // modify your invoice here return invoice; }

}

Then (this is the part that's missing in Trails 1.2) add your builder
to the BuilderDirector.
builderDirector.add(org.trails.demo.Invoice.class, new
InvoiceBuilder()); or something like this but using spring.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Alejandro Scandroli added a comment - 08/Feb/09 4:19 AM

fixed for both versions 1.2.2 and 2.0 in rev 1071 and 1072 respectively

Show
Alejandro Scandroli added a comment - 08/Feb/09 4:19 AM fixed for both versions 1.2.2 and 2.0 in rev 1071 and 1072 respectively

People

  • Assignee:
    Alejandro Scandroli
    Reporter:
    Hernan Soulages
Vote (0)
Watch (0)

Dates

  • Created:
    06/Feb/09 3:38 PM
    Updated:
    08/Feb/09 4:19 AM
    Resolved:
    08/Feb/09 4:19 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.