I understand nothing to builders

View: New views
2 Messages — Rating Filter:   Alert me  

I understand nothing to builders

by Ista Pouss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I want to build a list of pojos. I try to understand the groovy
builder concept. I see http://groovy.codehaus.org/GroovyMarkup

I doesn't understand what are people, person, and so on. Properties ?
Methods ? Setters ?... They say "someBuilder object has a method
called 'people'", but where is this method ? I don't see any "new
MyPojo()" in the exemple, so I suppose there's some HashMap somewhere
?

I should want to do something like :

class Pojo
{
 def propertyOne;
 def propertyTwo;
}

myList = {
 new Pojo(propertyOne: new Foo(), propertyTwo: new BigFoo()),
 new Pojo(propertyOne: new Foo(), propertyTwo: new BigFoo())
}

Is it that a "markup builder" ?

Thanks.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: I understand nothing to builders

by Fred Janon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ista,

For builders, check the Groovy site. It's  a Groovy thing used in Grails.

Fred

On Thu, Nov 5, 2009 at 23:53, Ista Pouss <istaous@...> wrote:
Hi,

I want to build a list of pojos. I try to understand the groovy
builder concept. I see http://groovy.codehaus.org/GroovyMarkup

I doesn't understand what are people, person, and so on. Properties ?
Methods ? Setters ?... They say "someBuilder object has a method
called 'people'", but where is this method ? I don't see any "new
MyPojo()" in the exemple, so I suppose there's some HashMap somewhere
?

I should want to do something like :

class Pojo
{
 def propertyOne;
 def propertyTwo;
}

myList = {
 new Pojo(propertyOne: new Foo(), propertyTwo: new BigFoo()),
 new Pojo(propertyOne: new Foo(), propertyTwo: new BigFoo())
}

Is it that a "markup builder" ?

Thanks.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email