Hi,
when creating a datastore, if we pass a set of invalid params to a specific
factory,
we get back useful exceptions, telling us that the connection could not be
made,
the file was not found, the caps document was invalid, and so on.

When doing the same with a coverage Format object, we get back... squat!
Just a null value indeed.

I want to propose we get back something useful instead that we can
communicate
to a user (skilled enough to read an exception, but still).
Options:
a) Break API behavior and add the ability to throw an Exception to
Format.getReader.
    For example, throw an IOException.
    This won't break the implementors, but it will break the users of the
library
b) Add a progress listener as a Hint in Format.getReader(object, hints),
and make the
    readers that want to be helpful set an exception in the progress (and
maybe also
    return progress if they want to, getting a reader might require time,
it sure does
    with the mosaic)
c) Add a hint with an empty List<Exception> that the store will populate
with all
    exceptions it sees fit. Exceptions could be populated also if returning
a reader,
    for example with the mosaic we could return a mosaic but for example
collect exceptions
    for the granules that we could not parse

Weighting pros and cons of all the cases, I'm torn between b) and c)
a) is how the API should have been designed from day 1, but doing that
change now
is going to break so many users that I'm not so eager to go that way... but
I'm willing
to be talked into adopting it anyways ;-)

Cheers
Andrea

-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to