Trails
  1. Trails
  2. TRAILS-174

Contribute builders to BuilderDirector

    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
    • Number of attachments :
      0

      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

          People

          • Assignee:
            Alejandro Scandroli
            Reporter:
            Hernan Soulages
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: