Hello Vadim,
I didn't get your point. What I mean is, suppose we are going to create an
ZNode. Consider the following example,
curatorFrameworkInstance.create().forPath("/ZNode/path");
In the above code, we have to surround with a try/catch since it is
expected to throw an exception of type *Exception*. According to your
explanation, how can this be a code written by me? What I am doing above is
just executing the methods provided. Can you elaborate on that?
-Imesha
On 21 November 2016 at 13:45, Vadim <[email protected]> wrote:
> Hello Imesha,
>
> As user of curator, I guess this is because Curator suppose to
> execute external code (like yours) and it does not know what type of the
> exception it will throw in advance. If you define specific exception --
> your code will be dependent on that and thus "hard dependency" arise. It
> breaks DIP principle from SOLID (https://en.wikipedia.org/
> wiki/SOLID_(object-oriented_design)) that is not good.
>
> Vadim.
>
>
>
>
> On 2016-11-21 09:12, Imesha Sudasingha wrote:
>
> Hi all,
>
> I was curious on why most of the methods in *CuratorFramework* throw
> exceptions of the type *Exception *which is the base class? In Zookeeper,
> they have specific set of custom exceptions like ZooKeeperException and so
> on. Do you have a specific reason for that?
>
> Thanks in advance!
>
> -Imesha
>
> --
> *Imesha Sudasingha*
> Undergraduate of Department of Computer Science and Engineering,
> University of Moratuwa.
>
>
--
*Imesha Sudasingha*
Undergraduate of Department of Computer Science and Engineering,
University of Moratuwa.