On Thu, Dec 9, 2010 at 12:00 AM, Justin Deoliveira <[email protected]> wrote:
> I think the idea is good but perhaps the interface needs a bit of tweaking.
> It might make more sense go reverse the notion and come up with a
> "StableFunction" because it seems that a function that returns a static
> value (like env) would seem to be the monitory. Perhaps I am wrong though.

The idea is that there are like 150 static ones (stable return value
as long as they
are not using feature attributes of course) and 2 dynamic ones.
I wanted to isolate the oddballs and avoid having people to mark the most
common type of function when making a new one.

> Also it would seem that a function implementing the interface simply to
> return false would be equivalent to not implementing the interface at all?
> So perhaps we could keep the interface strictly a marker interface?

I wanted to have a strict marker. But then again, how do I tell apart the
functions that are fully static from those that are static in a single request?
Duh, by using two marker interfaces :-)
See, the thing is, marking "random" as a dynamic function makes perfect
sense, not marking "env" at all seems a bit eccessive, the function will
return different values at different invocations if someone pokes with its
enviroment. Given that optimizations can not be performed if the function
is fully dynamic maybe better to just deal with that javadoc wise:

/**
 * A function whose return value may vary during a data access operation
 * even if the function is not given feature property values and the context
 * of the function is not changed. A function whose return values may change
 * during different data access operations or as a result of a change in their
 * context/configuration are not considered dynamic (enough).
 * Dynamic functions will not be optimized out as static values by the
 * filter/expression simplifier before the data access takes place
 */
interface DynamicFunction {
}

Better?

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584962313
fax:     +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:

WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to