directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ersin Er" <ersin...@gmail.com>
Subject Re: [ApacheDS] Partition design and interfaces
Date Wed, 16 Jan 2008 15:05:25 GMT
On Jan 16, 2008 5:00 PM, Alex Karasulu <akarasulu@apache.org> wrote:
> Hi Ersin,
>
> Glad to see you're lurking ...

Always around :-)

> On Jan 16, 2008 8:38 AM, Ersin Er <ersin.er@gmail.com> wrote:
> > Hi,
> >
> > I think Spring approach is here is nice. They have their own unchecked
> > exception hierarchy and adapters for different data stores convert
> > specific exceptions to one of the exceptions in Spring's hierarchy.
>
> This is a very interesting idea.  I'm just wondering what impact this would
> have on higher levels wrt exception handling.  If using unchecked exceptions
> are the preferred way then why would anyone bother having their API throw
> checked exceptions?

Well it's a bit relaxing approach. Hibernate also switched to
unchecked exceptions for v3.0. But our case may be a little bit
different. People in RDBMS world are very busy with writing SQL
embedded java codes and they are bored of catching all those
exceptions. This is not really the case for LDAP. Programming against
LDAP is less common. So you do not have a big crowd to make happy. So
you can follow a more strict path (checked exceptions). But still a
simple and LDAP centric data store exceptions hierarchy is a good
idea.

> > We
> > can define a simple LDAP related data store exception hierarchy and
> > expect all partition implementations to obey it.
> >
> >
> >
> >
>
> I guess by making all exceptions unchecked it makes exception raising and
> handling by API interface implementors and implementation users to be based
> on a looser contract.
>
> This can be refreshing but sometimes it results in wacky errors where
> trouble shooters often confused where why and how the exception resulted.
> But then again 90% of the time if the API is designed well and exceptions
> are rare then everything works out with less headaches.  I guess this is
> another tradeoff to consider.
>
> Does anyone else have some ideas on this specific topic Ersin brought up?
>
> Thanks,
> Alex
>
>
> >
> >
> >
> > On Jan 16, 2008 12:45 AM, Alex Karasulu <akarasulu@apache.org> wrote:
> > > Hi all,
> > >
> > > Different underlying stores have different kinds of checked exceptions
> they
> > > throw at the lowest level.  For example JDBM is humble and just uses IO
> > > exceptions.  The JE authors use an exception hierarchy based on
> > > DatabaseException.  I was wondering if there was a preference out the
> base
> > > class for what exceptions are thrown from partitions?  Right now there
> are a
> > > few options:
> > >
> > > (1) Throw exceptions that extend IOException (works well with JDBM)
> > > (2) Throw NamingExceptions works well with Java Naming but we have a bad
> > > taste in our mouths from this.
> > > (3) Create our own base class for exceptions thrown at these lower
> layers
> > > like say PartitionException
> > >
> > > Right now I went with IOException but I'm thinking it might be biased
> > > towards a particular partition implementation.  Does anyone have some
> > > opinion one way or the other?
> > >
> > > Alex
> > >
> > >
> > >
> > >
> >
> >
> >
> > --
> > Ersin Er
> >
>
>



-- 
Ersin Er

Mime
View raw message