groovy

ObjectGraphBuilder: add a general purpose bean factory

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.6.5, 1.7-beta-2
  • Fix Version/s: 1.6.6, 1.7-rc-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

SwingBuilder sports a bean() capable of wiring an existing bean instance into the build process. OGB can't do that.
It will be great to have this feature as a developer will be able to tweak any bean instance using the builder syntax

Company acme = ... // fetch company from a webservice perhaps??
ogb.bean(acme) {
   // add a few employees more
   employee(name: "Duke")
   employee(name: "Tux")
}

Activity

Hide
Andres Almiray added a comment - - edited

OGB has a bean node now. This name can be changed in case it clashes with a valid Bean class.

obg.beanFactoryName = "object"
ogb.object(new Company(), name: "ACME") {
   employee(name: "Duke")
}

The value of the bean node may be any of the following:

  • a Class
  • an instance of any Class (excluding String and GString)
Show
Andres Almiray added a comment - - edited OGB has a bean node now. This name can be changed in case it clashes with a valid Bean class.
obg.beanFactoryName = "object"
ogb.object(new Company(), name: "ACME") {
   employee(name: "Duke")
}
The value of the bean node may be any of the following:
  • a Class
  • an instance of any Class (excluding String and GString)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: