[ANN] MagmaServerLoader-cmm.19 - Complex Queries

Brent Pinkney brent.pinkney at aircom.co.za
Wed Aug 9 08:45:41 UTC 2006


Hi Göran,

Contratulations of your Seaside + Magma application.

As for the new complex queries, it is preferable to use a more sematically meaningful
formal argument in the #where: block.

viz:
	 friends := self people where: 
				[ :person | person lastName between: 'Jackson' and: 'Muller' ].

instead of:

	 myReader := aMagmaCollection where:
		 		[ :reader | reader read: #lastName from: 'Jackson' to: 'Muller' ].

Magma uses all sorts of posh Smalltall techniques to make this level of readability,
and hopefully elegance, possible.

Of couse, the purpose of this work is to make complex queries possible:

	 oldies := self people 
				where: [ :person | 
					( (person lastName between: 'Jackson' and: 'Smith')
						&& (person age > 30) )
					|| (person lastName = 'Pinkney') ]
				distinct: true
				sortedBy: #age
				descending: true.

	oldies do: [ :oldie | oldie doSomething ].

We hope you like this.

Brent


More information about the Magma mailing list