James Macgill wrote:
I would like to suggest that the getDefault * methods be depricated and
then removed?
And and createPointSymbolizer() return a symbolizer set up according to
the defaults (specfied in the SLD 1.0 spec).
Can anyone think of a reason why I should not do this? This *is* a
Factory its job is to create things ...
One reason for the broken code was to detect when something was set to
defalt values so that the serialization to SLD would not be too
verbose. We perhaps need null objects instead (objects to reporesent
nulls or actual nulls...).
If someone explicity sets something that happens to match a defalt
then it SHOULD get written into the SLD so a simple check to see if
values == default would not be enough.
Interesting, problem with using null Objects would be people trying to
modify them, however
it *would* be no more work then a check for null. Still not entirely
comfortable with the idea,
something does not seem scalable.
Another idea I had (a bad one) was to make a DefaultStyleFactory,
produced the default
values. Yep that is a terrible idea.
The thing I like most about the null object idea is the fact that we can
move the default values
indicated in the specification out into the interface where they would
be visible. Not hidden
as part of a Factory (and cascading the number of methods that must be
implemented by the
factory.
Okay so here is a plan - illustrated with Stroke
1. Make the Null object indicating the defaults for Stroke - (either
DefaultStroke or NullStroke)
2. Ensure it cannot be modified, and can be reused - it is literally a
replacement for null after all
3. Set up StyleFactory.create( Stroke ) or StyleFactory.createStroke(
Stroke )
(clone is a bad idea as it will not let you Tranfer data structure
between implementations)
Then we get a choice:
4. No code breaks - StyleFactory.defaultStroke - return createStroke(
NullStroke )
4. Breakage - StyleFactory.defaultStroke - return DefaultStroke
Regardless the StyleFactory.default* methods can get deprecated this round.
Jody
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel